View Full Version : multiple commands button


rubble
10 October 2007, 04:59 PM
Hi,

I'm kind of new to MEL, and I was wondering if someone could point me in the right direction with a UI I'm working on.


Basically, I want to be able to close a window and perform an action at the same time.

I was following this thread:

http://forums.cgsociety.org/showthread.php?f=89&t=287203&highlight=multiple+commands
which seems to be very much like what I wanted, except that my "OK" function is a string.



Here's what I've got:




$Window = `window -title "Window"
-iconName "Locator"
-widthHeight 200 50`;
columnLayout;

$OK = ("deleteUI " + $Window);


button -label "OK" -command $OK;

showWindow $Window;





global proc Proc2( )

{

spaceLocator -p 0 0 0;

}





How do I get it to run Proc2 while closing the window?


Thanks in advance for the help.

trancor
10 October 2007, 05:37 PM
button -label "OK" -command "$OK; Proc2;";


That should work for ya. The command flag in the button command is like a string of mel, you can do anything in it, you don't even need to make procs if you don't want. But procs are the way to go anyway.

rubble
10 October 2007, 06:44 PM
hmm, it's still giving me a syntax error.

// Error: $OK; Proc2; //
// Error: Syntax error //

mhovland
10 October 2007, 07:52 PM
This is your fix, let me know if you need an explanation.


$OK = ("deleteUI " + $Window + "; Proc2;");

rubble
10 October 2007, 05:11 AM
Thanks, that worked perfectly!

CGTalk Moderation
10 October 2007, 05:11 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.


1