Documentation: best source?
kray at sonsothunder.com
Sat Jul 10 18:38:08 CDT 2004
> Yes, I did that, but none seemed to fit the ticket. In the
> end the label property did the trick.
One caveat, Kaveh - the label property is set to the same value as the
"selectedText" property of the button. However the label can be changed
without affecting what is the currenly selected item, in which case,
querying the label won't help. Here's an example of where this might happen:
Suppose you had a limited amount of space for an option button and wanted it
to show ellipses ("...") if the name was too long to fit the width of the
option button. So something simple like this:
-- script of the option button
on menuPick pChoice
if length(pChoice) > 10 then
set the label of me to char 1 to 10 of pChoice & "..."
set the label of me to pChoice
Suppose the option button had the following menu items:
Option Number 1
Option Number 2
If you selected "Option Number 1" from the menu, the label would read
"Option Num..." but the *selectedText* of the button is "Option Number 1".
Granted, this probably won't happen in your situation, but I just wanted to
clarify the difference between the two properties.
(oh, and if you *really* were going to attempt what I'm talking about above,
you'd need to check the formattedWidth() and not length() (since character
widths differ from font to font)).
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/
More information about the use-livecode