RolloutCreator - Get Rollout Class

Hi there, i know i have another thread pending, but i'm trying to make a quick script, using RolloutCreator for the first time.

I have to create X copies of a rollout and add them into a rolloutfloater, i just need one parameters (a number) to difference them, this parts seems to work, but i can't manage to create a rollout outside my function.

2nd Problem (minor): i cant' add the tooltip parameter when creating the button.. but it work well to assign a string when the rollout open.

3rd Problem: to assign tooltip or make events, i have to imput the right name and not the var wich contain the string name of the button (it result a string and not a button class) i wanted to avoid the execute function.

Here is the code:

fn createrolls thenumber thevar =
(
therollname = "roll" + thenumber as string
therollcaption = "Copy/Paste" + thenumber as string
button1name = "Copyselected" + thenumber as string
button1caption = "Copy" + thenumber as string
 
thevar = rolloutCreator therollname therollcaption
thevar.begin()
thevar.addControl #button button1name button1caption filter:on paramStr:"width:100 height:20"
thevar.addHandler therollname #open filter:on codeStr:" \n print thenumber as string"
thevar.end()
)
 
createrolls 2 toto
--createDialog toto
 
-- Copyselected2.tooltip = @test@

I wanted to hold the rollout into the var toto, but it's seems to be a dirty way of doing it.

thank's in advance for your help, this forum is the only source i have when i'm lost. I've been looking on the web for 2 days, but i can't find a good response.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
locke's picture

Thank you @theonlyaaron, It

Thank you @theonlyaaron,
It seems that Rollout creator use the execute command and i wanted to avoid this heavy function. So I choose a number instead of making a function for x Rollouts. I use it to modify the Copitor script made by @zOffTy as requested by my co-workers.

theonlyaaron's picture

I have done a similar thing,

I have done a similar thing, for an image sequence preview script. I ended up using the 'execute' function, and was able to get it to work. However it got very difficult to maintain, or troubleshoot, because any error just returned the string. So, I don't have any advice for you other than it is possible, but not recommended.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.