Hullbr3ach
04-10-2002, 02:54 AM
I have written the following script and do not understand why it is not possible to pass string arrays to procedures when selecting a menu item or when pressing the button.
Just copy & paste into Maya, you will see.
proc someProcedure(string $someArray[])
{
// Working on the array in here. Uninteresting for the example.
}
proc createUI ()
{
string $someArray[];
string $window = `window -title "testWindow" -menuBar true myWindow`;
menuBarLayout menuBarMain;
menu -label "File" menuMenuFile;
menuItem -label "Start" -command ("someProcedure($someArray)");
setParent..;
setParent..;
columnLayout -columnWidth 150;
button -label "test" -command ("someProcedure($someArray)");
setParent..;
showWindow $window;
}
createUI;
The array is declared inside the procedure but MEL still complains that it can't find it...
Is there any way around this without using a global string array?
Thanks already!
Markus
Just copy & paste into Maya, you will see.
proc someProcedure(string $someArray[])
{
// Working on the array in here. Uninteresting for the example.
}
proc createUI ()
{
string $someArray[];
string $window = `window -title "testWindow" -menuBar true myWindow`;
menuBarLayout menuBarMain;
menu -label "File" menuMenuFile;
menuItem -label "Start" -command ("someProcedure($someArray)");
setParent..;
setParent..;
columnLayout -columnWidth 150;
button -label "test" -command ("someProcedure($someArray)");
setParent..;
showWindow $window;
}
createUI;
The array is declared inside the procedure but MEL still complains that it can't find it...
Is there any way around this without using a global string array?
Thanks already!
Markus
