I have a group containing 10 vertically oriented check boxes and I also have a list with <n> strings.
Every string in the list is to be the caption of the corresponding checkbox by position, i.e. the string in position 4 provides the caption for the fourth checkbox from the top. The checkboxes are named CB1 through CB10.
If there are less than 10 entries in the list, I'd like to hide the "extra" checkboxes, i.e. if the list contained only 9 entries then the bottom most checkbox would be hidden.
I have a feeling that this should just take a handful of lines, yet I can only come up with ugly convoluted code...
Would somebody give me hand?
TIA,
Kai
Newbie: Group struggle
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Kai,
What you want should be something like the following (untested):
Best,
Mark
What you want should be something like the following (untested):
Code: Select all
set the lockloc of grp 1 to true
repeat with x = 1 to 10 -- nr of checkboxes
hide btn x of grp 1
end repeat
repeat with x = 1 to number of lines of theStrings
set the tooltip of btn x to line x of theStrings -- or do you mean label?
set the top of btn x to (the top of grp 1) + (x-1)*24
show btn x of grp 1
end repeat
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode