Mikademius
07-04-2005, 10:40 AM
Try this code:
window;
columnLayout;
button -label "colorChange" -c "choseColor" -bgc 1 1 1 colorButton;
showWindow;
proc choseColor()
{
colorEditor;
if (`colorEditor -query -result`)
{
float $rgbValues[] = `colorEditor -query -rgb`;
button -e
-bgc $rgbValues[0] $rgbValues[1] $rgbValues[2]
colorButton;
}
}
What this little script does is this:
-creates a window with abutton.
-the button has a command that calls the proc choseColor (opens colorEditor and edits the bgcolor of the button to the color you just chose)
Problem: The button color doesn't change until you click it. sometimes it changes half of the button.
Is there a way to force the window to updtae without doing any other actions influencing other coontrols? Or is this updateproblem known and is there another way to fix it?
maya 6.0 on win xp
window;
columnLayout;
button -label "colorChange" -c "choseColor" -bgc 1 1 1 colorButton;
showWindow;
proc choseColor()
{
colorEditor;
if (`colorEditor -query -result`)
{
float $rgbValues[] = `colorEditor -query -rgb`;
button -e
-bgc $rgbValues[0] $rgbValues[1] $rgbValues[2]
colorButton;
}
}
What this little script does is this:
-creates a window with abutton.
-the button has a command that calls the proc choseColor (opens colorEditor and edits the bgcolor of the button to the color you just chose)
Problem: The button color doesn't change until you click it. sometimes it changes half of the button.
Is there a way to force the window to updtae without doing any other actions influencing other coontrols? Or is this updateproblem known and is there another way to fix it?
maya 6.0 on win xp
