View Full Version : Simple UI pb

06 June 2003, 06:40 PM
Because of the floatField, it returns :
// Error: Error while parsing arguments. //

string $mliWindow = `window -title "modifyLightIntensity" -s false -wh 300 200`;
columnLayout -adj true ;
float $incrementValue = `floatField -step 0.1 -value "" `;
button -label "Ok" -c "print (`textField -q -value $incrementValue`);";
showWindow $mliWindow;

06 June 2003, 07:56 PM
You should fill in a value after the value flag, and not place empty double quotes.

:: Galactor ::

06 June 2003, 08:17 PM
This simple line alone doesn't work either :surprised :annoyed: :thumbsdow
If I test the sample in the doc, it works! So the function floatField right exists!

floatField -value "cool";
// Error: Error while parsing arguments. //

Help me !

06 June 2003, 09:53 PM
You need to pass the -value flag a float, not a string.
This is why it works in the example from the docs and not in your script.

OR just don't pass the -value flag at all if you don't want it to have a certain value when the control is first drawn. I think if you don't use the flag the value will be 0 to start with.

06 June 2003, 10:57 PM
Ok you are true... I'll try it.
And about my way to work with UI... is it the best and easier way?

06 June 2003, 12:25 AM
Seems like you want to add Text to a field, so use a textField instead of a floatfield. Then
textField -text string "cool" should work!

06 June 2003, 03:03 AM
No thanks!
It's right a float I need, because the command called by button will require a float argument


CGTalk Moderation
01 January 2006, 11:00 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.