Setting foreground color deletes text in a field

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
grovecat
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 99
Joined: Thu Aug 04, 2011 10:32 am

Setting foreground color deletes text in a field

Post by grovecat » Mon Apr 16, 2012 6:58 am

My app allows a user to enter text into a field and also to change the background colour. When a dark colour is chosen, my script changes the foreground colour to white to make it more readable. If the user selects a colour before entering any text, all works as expected (e.g. a red field with white text).

However, if the user enters text before choosing a colour, the background changes as expected but the text disappears. Text typed in at that point does appear as white (or black in the case of light colours). Changing just the background colour does retain the text -- it is only a change in foreground colour that deletes it. In the IDE the text does not get deleted -- only in the simulator and on an iPad.

So I tried storing the text in a variable, then putting it back in after the colour changes. But it simply does not appear even though I have proved that the variable does contain the text.

So, any clues what is happening here?

TIA
Don

Klaus
Posts: 14235
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Setting foreground color deletes text in a field

Post by Klaus » Mon Apr 16, 2012 12:24 pm

Hi Don,

welcome to the forum! :)
grovecat wrote:So, any clues what is happening here?
Not without taking a look at your script(s)! 8)


Best

Klaus

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4177
Joined: Sun Jan 07, 2007 9:12 pm

Re: Setting foreground color deletes text in a field

Post by bn » Mon Apr 16, 2012 12:34 pm

Hi Don,

I don't see that. Works alright if I understood correctly. Tested with Livecode 5.5 Simulator, Xcode 3.2.5 MacOSX 10.6.8 for iOS version 4.2

Could you post a simplified stack that shows your problem?

Kind regards

Bernd

grovecat
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 99
Joined: Thu Aug 04, 2011 10:32 am

Re: Setting foreground color deletes text in a field

Post by grovecat » Mon Apr 16, 2012 2:38 pm

The gremlins are getting at me. I made a very simple stack to just do what I described and it works on the simulator.
Obviously I should have done that first before posting a question - sorry.

I must have some other factor interfering in my app, so I'll have to track it down.

Thanks for the responses.

Cheers
Don

Post Reply