Page 1 of 1
Change Text Colour of Group
Posted: Tue Apr 16, 2019 2:33 pm
by hrcap
Hi All
I have two radio buttons:
- England
- Australia
These are grouped into a group titled "group_countries"
I would like to be able to set the text colour of the group but can't work out how to do this, I have tried:
set the textcolor of group "group_countries" to 0, 0, 0
does anybody know how to achieve this?
Many Thanks
Re: Change Text Colour of Group
Posted: Tue Apr 16, 2019 2:38 pm
by FourthWorld
TextColor used for inline text in fields. For control labels try the foregroundColor.
Re: Change Text Colour of Group
Posted: Tue Apr 16, 2019 2:47 pm
by hrcap
Hi Richard
Thank you very much for the input, I have tried this but unfortunately still no luck, I think the issue is more focussed around how to get the text colour of the radio buttons to change as a group.
For example if I use the following on an individual button it works
set the textcolor of me to 0, 0, 0
Whereas using the following to try to change the colour of all items in the group doesnt
set the textcolor of group "group_countries" to 0, 0, 0
(a little bit difficult to explain clearly)
Many Thanks
Re: Change Text Colour of Group
Posted: Tue Apr 16, 2019 3:40 pm
by bogs
I think what your looking for is something like this :
Code: Select all
repeat with x=1 to the number of controls of group "rdoButtons"
set the foregroundColor of control x to "purple"
end repeat
The above assumes you only have radio buttons in the group, but you can target specific controls more finely if needed.
Re: Change Text Colour of Group
Posted: Tue Apr 16, 2019 4:31 pm
by Klaus
Hi all,
groups do not have a "textcolor" property, you mean the "foegroundcolor".
Hint:
When setting this prop for the group all its children will in fact INHERIT this property, so all textcolor of all childrens will change!
UNLESS you already have set this property for some objects in the group manually (or by script) then this will overwrite the inheritance!
Best
Klaus
Re: Change Text Colour of Group
Posted: Tue Apr 16, 2019 5:58 pm
by hrcap
Thanks all, the reason that is was not working is because I had already set the text size prior to establishing the script on the group, thus the group script did not take effect.
I started from scratch and the group script then worked.
Many Thanks