Radio buttons with custom icons don't always hilite

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

standgale
Posts: 26
Joined: Fri May 07, 2021 4:12 am

Radio buttons with custom icons don't always hilite

Post by standgale » Thu Jul 01, 2021 4:17 am

Hi,

I have replaced the Icon and Hilite Icon of my radio buttons with images of bigger radio buttons. I find that frequently when you quickly click on a radio button it will briefly hilight and then un-hilight again, leaving no button hilighted.
There is no code associated with them at this point. They're just doing their default livecode thing.

The problem happens randomly, sometimes after 4 clicks, sometimes after 20. I think its when you click quickly whereas if you click more deliberately it doesn't happen. I have tried clicking into the centre of the button and more on the edge but it happens in both cases.

I tried clicking about 100 times on some default radio buttons and it didn't happen.

Any ideas? Its not great for usability.

Running on Windows. Happens both when running in the livecode development environment and when running on its own.
Dell Latitude laptop, Windows 10 Enterprise.
Last edited by standgale on Fri Jul 02, 2021 2:27 am, edited 1 time in total.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Radio buttons with custom icons don't always hilite

Post by richmond62 » Thu Jul 01, 2021 7:11 am

Frankly I'd cook up my own buttons and then you'd have 100% control over
how they'd behave.

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Radio buttons with custom icons don't always hilite

Post by Klaus » Thu Jul 01, 2021 11:17 am

How do you script the (in LC automatic) behavior of a group of your custom radio buttons?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9579
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Radio buttons with custom icons don't always hilite

Post by dunbarx » Thu Jul 01, 2021 1:02 pm

HI.
I find that frequently when you quickly click on a radio button it will briefly hilight and then un-hilight again, leaving no button hilighted.
I have never seen this. But are you saying that ordinary radio buttons exhibit this, or just your souped-up ones?

Craig

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Radio buttons with custom icons don't always hilite

Post by jmburnod » Thu Jul 01, 2021 2:29 pm

Hi standgale,
Here is an exanple custom radiobutton works fine on OSX
can you please test it on windows.
viewtopic.php?f=53&t=29318&hilit=radio#p154618
Best regards
Jean-Marc
https://alternatic.ch

kdjanz
Posts: 300
Joined: Fri Dec 09, 2011 12:12 pm
Location: Fort Saskatchewan, AB Canada

Re: Radio buttons with custom icons don't always hilite

Post by kdjanz » Thu Jul 01, 2021 6:23 pm

Another thought -

If this only occurs with your enlarged images of the buttons, it may be that there are some stray transparent pixels in your images. If your mouse happens to hit one of those, the click will go right through the image and get lost. You could try changing the images to circle graphics with a solid fill colour and see if the issue goes away.

Short answer - check your graphics to make sure there are no "holes".

jiml
Posts: 336
Joined: Sat Dec 09, 2006 1:27 am
Location: Los Angeles

Re: Radio buttons with custom icons don't always hilite

Post by jiml » Thu Jul 01, 2021 8:13 pm

standgale
I can't reproduce this.
Are you certain you don't have a script in the group or message path that is also being invoked?

standgale
Posts: 26
Joined: Fri May 07, 2021 4:12 am

Re: Radio buttons with custom icons don't always hilite

Post by standgale » Fri Jul 02, 2021 2:14 am

jmburnod wrote:
Thu Jul 01, 2021 2:29 pm
Hi standgale,
Here is an exanple custom radiobutton works fine on OSX
can you please test it on windows.
(cannot include link in my reply)
Best regards
Jean-Marc
Hi, I tested with this one - just clicking back and forth from one radio button to the other about 100 times and got about 8 times when it highlighted for a moment then unlighted, leaving both unhighlighted

standgale
Posts: 26
Joined: Fri May 07, 2021 4:12 am

Re: Radio buttons with custom icons don't always hilite

Post by standgale » Fri Jul 02, 2021 2:17 am

dunbarx wrote:
Thu Jul 01, 2021 1:02 pm
HI.
I find that frequently when you quickly click on a radio button it will briefly hilight and then un-hilight again, leaving no button hilighted.
I have never seen this. But are you saying that ordinary radio buttons exhibit this, or just your souped-up ones?

Craig
I tried a bunch of clicks on default radio buttons with no issues.

standgale
Posts: 26
Joined: Fri May 07, 2021 4:12 am

Re: Radio buttons with custom icons don't always hilite

Post by standgale » Fri Jul 02, 2021 2:20 am

Klaus wrote:
Thu Jul 01, 2021 11:17 am
How do you script the (in LC automatic) behavior of a group of your custom radio buttons?
There's no script, they are just normal radio buttons dragged out of the tool bar and grouped, with the Icon and Hilite icon changed to different images via the property inspector. The images are stored on another card.

standgale
Posts: 26
Joined: Fri May 07, 2021 4:12 am

Re: Radio buttons with custom icons don't always hilite

Post by standgale » Fri Jul 02, 2021 2:23 am

kdjanz wrote:
Thu Jul 01, 2021 6:23 pm
Another thought -

If this only occurs with your enlarged images of the buttons, it may be that there are some stray transparent pixels in your images. If your mouse happens to hit one of those, the click will go right through the image and get lost. You could try changing the images to circle graphics with a solid fill colour and see if the issue goes away.

Short answer - check your graphics to make sure there are no "holes".
I thought of that but I think they are ok, plus it happened with the example I tried just now which someone posted. Also, they do highlight briefly before unhighlighting again, so it does hit something in the first instance.

I'm thinking that maybe the mouse moves slightly during the click and ... something? But why do the default radio buttons work?

Ok, I tested using the buttons by the touchpad (instead of the USB mouse plugged into the laptop). The buttons by the touchpad produced an even worse result. I think its because you can move your finger slightly over the touchpad at the same time you press the mouse button.

Deliberately moving my finger on the touchpad as I click reproduces the issue or even produces a flickering radio button - flickering between hilighted and unhilighted. Although its way harder to move at the same times as you click on the default radio buttons because they are so small, experimentation with the default buttons does not produce the error.

stam
Posts: 2634
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Radio buttons with custom icons don't always hilite

Post by stam » Fri Jul 02, 2021 11:57 am

Would you be able to share a simple stack with the offending radiobuttons?

standgale
Posts: 26
Joined: Fri May 07, 2021 4:12 am

Re: Radio buttons with custom icons don't always hilite

Post by standgale » Fri Jul 02, 2021 11:07 pm

stam wrote:
Fri Jul 02, 2021 11:57 am
Would you be able to share a simple stack with the offending radiobuttons?
The one shared by jmburnod has the same problem for me.

standgale
Posts: 26
Joined: Fri May 07, 2021 4:12 am

Re: Radio buttons with custom icons don't always hilite

Post by standgale » Fri Jul 02, 2021 11:55 pm

I found that if I turn off the auto highlight property and manually highlight in the "mouse up" then it seems to solve the issue.

I have attached a project containing the initial radio buttons, the ones with the above solution, and the defaults.
Attachments
problem radio buttons.zip
(3.15 KiB) Downloaded 128 times

stam
Posts: 2634
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Radio buttons with custom icons don't always hilite

Post by stam » Sat Jul 03, 2021 1:13 am

standgale wrote:
Fri Jul 02, 2021 11:07 pm
The one shared by jmburnod has the same problem for me.
Sorry, i missed that link.

It doesn't occur at all on mac (MacOS 11.4).

I fired up a virtual ubuntu installation on vitualbox - this does happen in LC 9.6.2 on ubuntu 20.04 - occasionally the radiobutton you click on appears refractory and doesn't hilite, but the previously highlighted one un-hilites so you end up with both radiobuttons un-hilited.

This doesn't happen when resetting the custom icon back to the default so its definitely a weird one... glad you found a work-around, but might be worth a bug report?

Post Reply

Return to “Talking LiveCode”