PDA

View Full Version : UI: How do you build an invisible control?


stzaske
07-02-2003, 03:22 PM
I'm just learning UI layout. Say I build a rowColumnLayout UI that is 2 rows by 2 columns, in this format


--------
| 1 | 2 |
--------
| 3 | 4 |
--------


Now say I want to populate this layout with two controls, buttonX (X) and TextY (Y) like this:

--------
| X | 2 |
--------
| 3 | Y |
--------

To do this, it seems I need to place 2 invisible controls in locations 2 and 3. How do I create an invisible control? Is there an equivalent to "& nbsp;" in MEL? I can build a text -l " "; control, but I'm assuming there is a more elegant solution.

-=STZ=-

dwalden74
07-02-2003, 04:25 PM
If your objective is to hide/show UI controls, then you can do that with a controlīs `-visible`flag. Otherwise Iīd go with the `text -l ""` technique. Itīs cleaner and a more widely acceptable way to create empty spaces.


:beer:
David

mhovland
07-02-2003, 07:23 PM
Originally posted by dwalden74
If your objective is to hide/show UI controls, then you can do that with a controlīs `-visible`flag. Otherwise Iīd go with the `text -l ""` technique. Itīs cleaner and a more widely acceptable way to create empty spaces.

David

Or you could use a formLayout and attach the controls together.

Try this out:

///////////////
string $window = `window -t "test window" -h 150 -w 150`;
string $form = `formLayout`;
string $button1 = `button -l "X" -w 50 -h 35`;
string $button2 = `button -l "Y" -w 50 -h 35`;

formLayout -edit
-af $button1 "left" 2
-af $button1 "top" 2
-ac $button2 "left" 2 $button1
-ac $button2 "top" 2 $button1
$form;

showWindow $window;
///////////////

That shoud get you on the right track :)

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