Text colour and groups
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 92
- Joined: Thu Feb 14, 2013 7:17 pm
Text colour and groups
A simple question I'm sure, but it is perplexing me. I've hunted through documentation and forums but can't find an answer.
I have a button that I want to use to change text color in a bunch of fields.
I have grouped the text fields into a group called testgroup.
When I use the following command it changes the group's foreground colour but not the underlying field's text color?
set textcolor of group "testgroup" to "black"
I don't want to change the text color of each field individually?
thx, Adam
I have a button that I want to use to change text color in a bunch of fields.
I have grouped the text fields into a group called testgroup.
When I use the following command it changes the group's foreground colour but not the underlying field's text color?
set textcolor of group "testgroup" to "black"
I don't want to change the text color of each field individually?
thx, Adam
Re: Text colour and groups
Hi Adam,
are you sure that the fields in the group do not have their TEXTFONT property set?
And better set the "forecolor" of the group, a group does not have a "textcolor"!
Best
Klaus
are you sure that the fields in the group do not have their TEXTFONT property set?
And better set the "forecolor" of the group, a group does not have a "textcolor"!

Best
Klaus
-
- Posts: 92
- Joined: Thu Feb 14, 2013 7:17 pm
Re: Text colour and groups
Klaus,
I thought forecolor was a synonym for textcolor (according to the livecode dictionary)? In any case I changed the command to use forecolor and still no difference.
I don't have any font assigned to the textfield when I examine it's properties?
Adam
I thought forecolor was a synonym for textcolor (according to the livecode dictionary)? In any case I changed the command to use forecolor and still no difference.
I don't have any font assigned to the textfield when I examine it's properties?
Adam
Re: Text colour and groups
Hm, does this also happen with a fresh stack and some grouped fields?
Tested here and works as exspected!? Also in the simulator!
Tested here and works as exspected!? Also in the simulator!
-
- Posts: 92
- Joined: Thu Feb 14, 2013 7:17 pm
Re: Text colour and groups
Thanks for trying. I just created a brand new stack and tried it and yes it does work. Yikes, that means something in my project stack is interfering. How do I track that down? I am using the latest version of Livecode 6.5.1.
Could it be a bug or is it likely some kind of property of the text field is interfering?
Could it be a bug or is it likely some kind of property of the text field is interfering?
Re: Text colour and groups
Text styles are inherited from the field, the group it's in, the card they're on, and so on. So if you have set the textcolor (yes it's just a synonym), of the field, then it won't matter what the textcolor of the group is.
In addition single chunks of text also can have styles. For example if you select all the text in a field, and then you use the IDE menu to set it's color to red, you're basically doing this:
If that is the case, even the textColor of the field won't matter, nor anything higher 'up' the inheritance chain.
To remove the color from the characters in a field you'd best do something like this in the message box:
In addition single chunks of text also can have styles. For example if you select all the text in a field, and then you use the IDE menu to set it's color to red, you're basically doing this:
Code: Select all
set the textcolor of char 1 to -1 of field "example" to red
To remove the color from the characters in a field you'd best do something like this in the message box:
Code: Select all
set the textcolor of char 1 to -1 of field "example" to empty
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
Re: Text colour and groups
Aha, great, but that is really not the problem here 

Re: Text colour and groups
I'm pretty sure it is, what makes you think it's not a problem with text property inheritance?
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
Re: Text colour and groups
As you might have read, we have already been through this.
The fields in the group do NOT have their textfont property set,
so setting their OWNERs (group) forecolor should in fact work!
Adam is currently searching for any non-obvious possible property
inheritance or other, maybe script related problems.
You ARE searching, Adam, aren't you!

The fields in the group do NOT have their textfont property set,
so setting their OWNERs (group) forecolor should in fact work!
Adam is currently searching for any non-obvious possible property
inheritance or other, maybe script related problems.
You ARE searching, Adam, aren't you!

-
- Posts: 92
- Joined: Thu Feb 14, 2013 7:17 pm
Re: Text colour and groups
I gave up searching. It just doesn't work in my stack but it does in a fresh stack. I'm not technical enough to track this down. I found another option.
My overall goal was to create a button for night mode (red on black) of my screen for use in a rescue boat. Night vision is lost when viewing a white-ish light source. This I succeeded, so all is well.
Thanks for trying to help. And no, Klaus is right, no text font properties were set at all.
Adam
My overall goal was to create a button for night mode (red on black) of my screen for use in a rescue boat. Night vision is lost when viewing a white-ish light source. This I succeeded, so all is well.
Thanks for trying to help. And no, Klaus is right, no text font properties were set at all.
Adam
Re: Text colour and groups
The field property may not be set but the text color of its individual characters may be. Try selecting all the text in the field and then use the Text menu to change the color to use the owners setting.
As BvG said, each character can have its own color, which will override the field setting. The only thing that can be causing the problem is an inheritance issue.
As BvG said, each character can have its own color, which will override the field setting. The only thing that can be causing the problem is an inheritance issue.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com