Page 1 of 2
Radio buttons with custom icons don't always hilite
Posted: Thu Jul 01, 2021 4:17 am
by standgale
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.
Re: Radio buttons with custom icons don't always hilite
Posted: Thu Jul 01, 2021 7:11 am
by richmond62
Frankly I'd cook up my own buttons and then you'd have 100% control over
how they'd behave.
Re: Radio buttons with custom icons don't always hilite
Posted: Thu Jul 01, 2021 11:17 am
by Klaus
How do you script the (in LC automatic) behavior of a group of your custom radio buttons?
Re: Radio buttons with custom icons don't always hilite
Posted: Thu Jul 01, 2021 1:02 pm
by dunbarx
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
Re: Radio buttons with custom icons don't always hilite
Posted: Thu Jul 01, 2021 2:29 pm
by jmburnod
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
Re: Radio buttons with custom icons don't always hilite
Posted: Thu Jul 01, 2021 6:23 pm
by kdjanz
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".
Re: Radio buttons with custom icons don't always hilite
Posted: Thu Jul 01, 2021 8:13 pm
by jiml
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?
Re: Radio buttons with custom icons don't always hilite
Posted: Fri Jul 02, 2021 2:14 am
by standgale
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
Re: Radio buttons with custom icons don't always hilite
Posted: Fri Jul 02, 2021 2:17 am
by standgale
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.
Re: Radio buttons with custom icons don't always hilite
Posted: Fri Jul 02, 2021 2:20 am
by standgale
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.
Re: Radio buttons with custom icons don't always hilite
Posted: Fri Jul 02, 2021 2:23 am
by standgale
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.
Re: Radio buttons with custom icons don't always hilite
Posted: Fri Jul 02, 2021 11:57 am
by stam
Would you be able to share a simple stack with the offending radiobuttons?
Re: Radio buttons with custom icons don't always hilite
Posted: Fri Jul 02, 2021 11:07 pm
by standgale
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.
Re: Radio buttons with custom icons don't always hilite
Posted: Fri Jul 02, 2021 11:55 pm
by standgale
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.
Re: Radio buttons with custom icons don't always hilite
Posted: Sat Jul 03, 2021 1:13 am
by stam
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?