optionMenu width?

How to adjust width of optionMenu without menuItem with label " " ?

I think you want to use optionMenuGrp as this has controls for the width of the column. optionMenu doesn't.

--g

I suppose you want to have certain width for the listbox in the option menu when it is empty. I don't think that is possible, even with the -width flag. Anyone has a solution please post the MEL snippet.

If you like here is a brute force/cheaty/hacky solution;

simply have a menuItem label composed of enough spaces to give the required width ( in the example below you have to replace the text with spaces as I have just seen that this posted reply won't display the spaces properly for some reason but it works in maya when the spaces are subsituted,
not elegant I know but I've had the same problem and haven't found a solution :wink:

//example
string $window = window -title "Brute Force"; columnLayout;
optionMenuGrp -label "Size" -extraLabel "cm" -columnWidth 2 80;
menuItem -label " put as many spaces as you need here ";
showWindow $window;

Anyone got a better solution please let me know

Tricky