Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Subframes "equally spaced", occupying all the available space of the parent frame

34 views
Skip to first unread message

Markos

unread,
Jun 17, 2018, 1:44:15 PM6/17/18
to
Hi,

I am creating a frame in notebook with the command:

ttk::frame .n.f5

.n add .n.f5 -text "Insert Book"

And I would like to put 3 subframes "equally spaced", one on the left, one on the center and the third on the right, occupying all the available space of the parent frame:

set frame_insert_left [labelframe .n.f5.insert_left -text "Text 1"]
set frame_insert_center [labelframe .n.f5.insert_center -text "Text 2"]
set frame_insert_right [labelframe .n.f5.insert_right -text "Text 3"]

grid $frame_insert_left -row 0 -column 0 -padx 10
grid $frame_insert_center -row 0 -column 1 -padx 10
grid $frame_insert_right -row 0 -column 2 -padx 10

And within these subframes include the other widgets.

I did that, but they're all moved to the left side.

What is the command to leave them equally spaced occupying all the available space of the parent frame (.n.f5)?

Thank you,
Markos

Gerald Lester

unread,
Jun 17, 2018, 4:27:30 PM6/17/18
to
For resizing with the grid geometry manager you also need to use the
following methods:
grid columnconfigure
grid rowconfigure

For what you described:
grid columnconfigure .n.f5 -weight {0 1 2} -weight 1
grid rowconfigure .n.f5 {0} -weight 1

There are other ways such as using the -uniform option also. Please
(re-)read the grid man/help page.

--
+----------------------------------------------------------------------+
| Gerald W. Lester, President, KNG Consulting LLC |
| Email: Gerald...@kng-consulting.net |
+----------------------------------------------------------------------+

Markos

unread,
Jun 17, 2018, 7:37:31 PM6/17/18
to
> | Email: Gerald.Lester at kng-consulting dot net |
> +----------------------------------------------------------------------+

Hi Gerald,

OK very good.

Now I can sleep and begin the week with, at least, one problem solved. :-)

Many thanks again for your help.
Markos
0 new messages