PDA

View Full Version : UI updateproblems


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

safakoner
07-04-2005, 12:58 PM
easy, try this

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;

}
button -e -vis 0 colorButton;
button -e -vis 1 colorButton;
}

Mikademius
07-04-2005, 01:58 PM
Thx :) Kind of sucks that the colors bug that much though... That you actually have to cheat maya.

CGTalk Moderation
07-04-2005, 01:58 PM
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.