Page 1 of 1

Setting foreground color deletes text in a field

Posted: Mon Apr 16, 2012 6:58 am
by grovecat
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

Re: Setting foreground color deletes text in a field

Posted: Mon Apr 16, 2012 12:24 pm
by Klaus
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

Re: Setting foreground color deletes text in a field

Posted: Mon Apr 16, 2012 12:34 pm
by bn
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

Re: Setting foreground color deletes text in a field

Posted: Mon Apr 16, 2012 2:38 pm
by grovecat
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