PDA

View Full Version : problem with button -e -align


ajk48n
07-23-2003, 06:01 AM
If I have this code:

window;
columnLayout;
$but = `button -label "Label" -align "center" -w 100`;
showWindow;

Now if this is run:

button -edit -label "Label" -align "left" -w 100 $but;

the alignment doesn't change. If this is run:

button -edit -label "New Label" -align "right" -w 100 $but;

the alignmnet does change, because , I think, the button is forced to redaw the label, so then must re-evaluate the alignment. Is there anyway to force the button to redraw itself with the new alignmnet.

I know you could rename the label to something temporary, and then rename it back, but I was wondering if there was a more succint way to do it.

dwalden74
07-23-2003, 08:44 AM
For me they change correctly in both cases. Try again. If it still doesn´t work for you, you could delete the button (`deleteUI`) and rebuild it.

:beer:
David

GDC
07-23-2003, 05:40 PM
When I try this the button only chages it's alignment when I press it. (When the label doens't change)
When the label changes it works correctly.

I found a work around, though.

button -edit -vis 0 -align "left" $but;
button -edit -vis 1 $but;

This seems to force the button to redraw it's self.

--g

dwalden74
07-24-2003, 07:51 AM
You can also use the "setFocus" command (setFocus $but). This will force it to redraw correctly.

-david

ajk48n
07-24-2003, 10:24 AM
Thanks for the replies. setFocus is exactly what I needed.

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