On Sun, 1 Mar 1998, Mark Harrison wrote:

> How can I make widgets grid or pack in any pattern
> besides a single column?  If someone can tell
> me how to make four buttons like this:
> 
>     A B
>     C D
> 
> With the grid and pack options I would be most
> appreciative!

I haven't used the grid option. I'd guess it does this quite easily. When
using the pack manager I usually build all windows as a series of vertical
frames, ie all packed -side top:

frame1
frame2
frame3

Then, each of these frames contains some number of frames or widgets
packed -side left.

So,

---------
| A   B |
---------
---------
| C   D |
---------

is one way to do this. Note that you can set frame borderwidths to zero
(and/or -relief flat) so the frames don't show.

When nesting frames like this, the vTcl "alias" feature is very handy. Set
the alias for each button, entry field, etc, to something useful then
access them in the global widget array. EG if button A has an alias of
buta, it's $widget(buta).

You'll appreciate this when you start cutting and pasting nested frames
full of widgets. The aliases themselves seem to get lost but you just have
to reset them. All the code that refers to widgets with the widget array
is still OK! 

...RickM...

---------------------------------------------------------------------------
To unsubscribe from the Visual Tcl mailing list, please send a message
to [EMAIL PROTECTED] with "unsubscribe vtcl [EMAIL PROTECTED]" in the
message body (where [EMAIL PROTECTED] is your e-mail address).

Reply via email to