View Full Version : Query in toolbar please help me asap :(

12 December 2012, 05:15 PM

I write the following code in mel to create button in tool bar

string $myWindow = `window`;
string $buttonForm = `formLayout -parent $myWindow`;
rowLayout -nc 4 -parent $buttonForm;
iconTextButton -style "iconOnly" -image1 "sphere.xpm" -label "sphere" ;
iconTextButton -style "iconOnly" -image1 "spotlight.xpm" -label "spotlight" ;
iconTextButton -style "iconOnly" -image1 "cone.xpm" -label "cone" ;
iconTextButton -style "iconOnly" -image1 "cube.xpm" -label "cube" -c "polyCube" ;
setParent ..;
toolBar -area "top" -content $myWindow;

and I want to do query to list all button to enable edit specifc button such as change the icon or make button gray as not enable (Like this code in shelftab):
global string $gShelfTopLevel;
string $currentShelf = `tabLayout -q -st $gShelfTopLevel`;
string $shelfContents[] = `shelfLayout -q -childArray ($currentShelf)`;
shelfButton -e -en 0 $shelfContents[0];

Plzzzzzzzzzzzzz help me asap

12 December 2012, 04:17 AM
I think what you want to do is query the -childArray of the rowLayout object

string $myChildren[]=`rowLayout -q -ca myButtonLayout`;

CGTalk Moderation
12 December 2012, 04:17 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.