Button highlite not switching icons on iOS

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
mvillion
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 107
Joined: Sun Feb 24, 2013 12:29 pm

Button highlite not switching icons on iOS

Post by mvillion » Sat Oct 13, 2018 10:13 pm

Hi

For years now, I have been skinning my buttons but loading to images onto a page then referencing them within the button as 'Icon' and 'hilite icon'. I then switch between the two images by changing the hilite property depending on whether the button is pressed or not.

This has worked well except suddenly I have two buttons that refuse to behave.

If I read the property, it is set correctly but the image is not the correct one. It is always showing the 'icon' rather than the 'hilite icon'.
In the IDE is works perfectly but on the device, it does not.

It gets weirder. I added a second button to force the hilite of the first button via script
The second button has this script

Code: Select all

set the highlite of button "FirstButton" to true
I press it, it does not work.
I manually toggle the first button on then off again and the same second button running the same script works!

This is just nuts. What am I missing here? Is there an object integrity checker or something like that? All suggestions gratefully received.

A further experiment had even weirder results

I added a third button giving it a very simple script.

Code: Select all

on mouseup
set the highlite of me to true
end mouseup 
A got the second button script to toggle the first and third button as well by the same kind of script.
The third button hilited as it should but the first one did not.
I then pressed the third button (setting the already hilited third button) and lo and behold the first button toggled. It is like the screen is not refreshing or something. The screen is unlocked and I am baffled.

In the IDE is works. On the Mac version (standalone) it works. On iOS it does not work (Should I say - it has stopped working)

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7214
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Button highlite not switching icons on iOS

Post by jacque » Sun Oct 14, 2018 5:19 pm

Yeah, that's crazy behavior. Icon image IDs can be the problem in some cases. Try setting the IDs if the icon images to something huge, above 50,000 and see what happens. There may be something in the iOS build that conflicts with low numbers.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

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

Re: Button highlite not switching icons on iOS

Post by Klaus » Sun Oct 14, 2018 5:42 pm

Hi mvillion,

although the engine allows sloppy syntax, maybe your combination is not in that range?
Allowed dictions:
...
set the HILITE of me to true
...
or
...
set the HIGHLIGHT of me to true
...
You used -> highlite and that may have created a custom property of your button(s) named -> highlite and set its value to TRUE. :D


Best

Klaus

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

Re: Button highlite not switching icons on iOS

Post by Klaus » Sun Oct 14, 2018 6:57 pm

No, that's not it, at least this works as exspected on macOS:

Code: Select all

set the highlite of me to true

mvillion
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 107
Joined: Sun Feb 24, 2013 12:29 pm

Re: Button highlite not switching icons on iOS

Post by mvillion » Sun Oct 14, 2018 7:46 pm

Hi all

Thanks for the comments. The thing I do not understand is that it worked for three years! (And still works on Windows and Mac)- it is only the iOS that has gone funny.

I made some significant changes to other parts of the application (on the reporting engine) but nothing to this part of the GUI. There are 15 button on the card and JUST TWO are refusing to behave properly. The code is the basically the same for all of them. It is as if the screen is not refreshing and triggering a refresh but toggling another button updates the screen

the screen is unlocked. I am not aware on any other thing that can 'freeze' a screen and I do not know how to trigger a screen refresh.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7214
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Button highlite not switching icons on iOS

Post by jacque » Sun Oct 14, 2018 7:51 pm

A hack to redraw the screen:

Code: Select all

set the backcolor of this cd to the backcolor of this cd
I don't think that's the problem but it's worth a try. What are the IDs of the icon images that don't update?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “iOS Deployment”