Simply Maya User Community

Simply Maya User Community (https://simplymaya.com/forum/index.php)
-   Programming (https://simplymaya.com/forum/forumdisplay.php?f=32)
-   -   Forcing a check box to be checked. (https://simplymaya.com/forum/showthread.php?t=19891)

nnng2001 17-01-2006 09:12 PM

Forcing a check box to be checked.
 
What is the mel command to ensure that a checkbox is always checked in the options dialog box of a command. Ie, in the duplicate options box, how would I make sure that the force unique name checkbox is always checked even after the user chooses reset settings.

Currently my approach is:

optionVar -iv "duplicateRenameChildren" 1;

but that does not hold when the resets tool options.

Thanks.

skywola 12-02-2006 09:46 PM

Not sure exactly what you are doing with the code because you did not post it, but you can create a window with checkboxes:

string $window = `window -width 50`;
columnLayout -adjustableColumn true;
checkBox;
checkBox -v true;
showWindow $window;
window -edit -widthHeight 40 60 $window;

and use the "-v true" parameter to default one as true. Regarding "resetting", if you are resetting within your own
code, you could just re-draw the window if necessary.
That is the best answer I know of without actually
seeing the code.

gster123 12-02-2006 10:32 PM

Not really used mel but i'd be sure in the form creation hat you would use checkbox.true so that on creation its checked, I come from a C++ background


All times are GMT. The time now is 02:30 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018