[Closed] Newbie question regarding rollouts
Hi all!
I have created a simple maxscript which opens a rollout, and I want to ensure that only one copy of it can be open at any time; but I just cant get it to work 🙁 I thought this would be extremely simple, but I cant figure out what I have done wrong… any help would be very much appreciated!
Anyway here is what I got (I have simplified it a bit from what I was actually trying to do, the result is still the same):
– begin testscript
global MyRolloutInit = false
global MyRollout
rollout MyRollout “My newbie rollout” width:164 height:180
(
label myLabel “Test Rollout” pos:[8,14] width:60 height:20
editText myEdit text:“blah” pos:[8,30] width:120 height:20
button btnDoStuff “Do it!” pos:[8,60] width:60 height:20
button btnClose “Close” pos:[92,60] width:60 height:20
fn DoStuff =
(
print "doing stuff..."
)
on MyRollout open do
(
MyRolloutInit = true
)
on MyRollout close do
(
MyRolloutInit = false
)
on btnDoStuff pressed do
(
DoStuff()
)
on btnClose pressed do
(
RemoveRollout MyRollout
)
)
if( MyRolloutInit == undefined or MyRolloutInit == false ) do
(
AddRollout MyRollout
)
– end testscript
Is it me being extremely stupid ? What have I missed ? Help very much apprciated!!
Thanks!!
Bjoern
I am showing you the tecnique, so you can apply it to yours.
(
global newRollout
try(destroyDialog newRollout) catch()
rollout newRollout “New Rollout”
(
button press “Press”
)
createDialog newRollout 100 60
)
See ya