Creating Elements Dynamically
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Creating Elements Dynamically
Hello.
Rev tutorials show me how to drag and drop elemts into a stack....but say I need to create several hundred elements in RR like checkboxes. This would need to be done dynamically as the Rev interface cannot handle so many physical elements in the interface at once. It completely slows down my machine.
So my question is:
How can you create checkboxes dynamically in Rev?
Is it possible?
Cheers
Bidge
Rev tutorials show me how to drag and drop elemts into a stack....but say I need to create several hundred elements in RR like checkboxes. This would need to be done dynamically as the Rev interface cannot handle so many physical elements in the interface at once. It completely slows down my machine.
So my question is:
How can you create checkboxes dynamically in Rev?
Is it possible?
Cheers
Bidge
Bidge
try this script, some of the options are just to show that you can code a lot of things into these checkboxes,
regards
Bernd
try this script, some of the options are just to show that you can code a lot of things into these checkboxes,
Code: Select all
on mouseUp
reset the templatebutton
set the style of the templatebutton to "checkbox"
set the hiliteborder of the templatebutton to false
set the tooltip of the templatebutton to "click me to make a change" -- optional
-- you can set a lot more of the properties of the templatebutton here
put the colornames into tColors
put "on mouseUp" & cr & "answer the short name of me" & cr & "end mouseUp" into tScript
put 50 into tButtonLeft -- start left position
put 50 into tButtonTop -- start top position
put 1 into tCounter
put 3 into tCollums -- adjust for No of Collums
put 3 into tRows -- adjust for No of Rows
lock screen
repeat with i= 1 to tCollums
repeat with j = 1 to tRows
create button
set the name of the last button to "myButton" & tCounter -- optional
set the label of the last button to "Label of btn " & tCounter -- optional
set the script of the last button to tScript -- optional
set the foregroundcolor of the last button to any line of tColors -- optional and not advised
set the top of the last button to tButtonTop
add the height of the last button + 4 to tButtonTop -- adjust
set the left of the last button to tButtonLeft
add 1 to tCounter
end repeat
put 50 into tButtonTop
add the width of the last button + 4 to tButtonLeft -- adjust
end repeat
end mouseUp
Bernd
-
- VIP Livecode Opensource Backer
- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
- Contact:
Be aware that there are 'scriptLimits' that come into play when running a standalone. If you want to add scripts to these dynamic controls, they can be no longer than 10 lines; so if they need to be longer, you should delve into the message path, and more specifically behaviors, frontscripts and backscripts.
A good read on this topic is Richard Gaskin's article Extending the Runtime Revolution Message Path, which explains this in great detail and clarity.
HTH,
Jan Schenkel.
A good read on this topic is Richard Gaskin's article Extending the Runtime Revolution Message Path, which explains this in great detail and clarity.
HTH,
Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
www.quartam.com