PDA

View Full Version : Newbie question regarding rollouts


BjoernD
09-23-2004, 12:11 PM
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 :sad: 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

DentonVanZan
09-24-2004, 08:57 PM
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

CGTalk Moderation
01-19-2006, 09:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.