I have to confess that I'm not an experienced Tcl/Tk user, so there obviously some lack of knowledge on my side.
Honestly, I got interested in Tk when I found C++/Tk. Now, I'm learning Tk to use it with C++ and Python.
I'm going to write simple application, very simple, and I'd like to ask what gemetry manager would be best for me. Should I organize widgets using pack() function or may be construct layout with grid?
Here is simple scheme of UI layout:
----------------------------------
MENU OR NO MENU
----------------------------------
FIRST (LONG) COMBO BOX
----------------------------------
SECOND COMBO BOX
----------------------------------
CANVAS (400x400, 600x600 px size)
----------------------------------
TEXT WIDGET (data input/log output)
----------------------------------
SOME BUTTONS OR NO BUTTONS
----------------------------------
As you can see, it's very trivial UI :-)
I'm going to paint my UI mainly with rows. If I'll use some (2-4) buttons in the last row, then I could use some columns (then the rest of rows should span adequately).
So, what geometry manager would you recommend, pack or grid?
Thanks in advance.
Cheers
Mateusz Loskot
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
According to all usage I've seen, grid manager is useful only when there's a high regularity of layout in both horizontal and vertical directions - think of grid as a "table manager". Managing the buttons on the calculator application is a good example of this.
In your case pack will be perfect. Learn about frames - they can be extremely useful for organizing nested hierarchies in the layout. See examples 4 and 6 on the C++/Tk web page (also as part of the distribution).
Maciej
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I have to confess that I'm not an experienced Tcl/Tk user, so there obviously some lack of knowledge on my side.
Honestly, I got interested in Tk when I found C++/Tk. Now, I'm learning Tk to use it with C++ and Python.
I'm going to write simple application, very simple, and I'd like to ask what gemetry manager would be best for me. Should I organize widgets using pack() function or may be construct layout with grid?
Here is simple scheme of UI layout:
----------------------------------
MENU OR NO MENU
----------------------------------
FIRST (LONG) COMBO BOX
----------------------------------
SECOND COMBO BOX
----------------------------------
CANVAS (400x400, 600x600 px size)
----------------------------------
TEXT WIDGET (data input/log output)
----------------------------------
SOME BUTTONS OR NO BUTTONS
----------------------------------
As you can see, it's very trivial UI :-)
I'm going to paint my UI mainly with rows. If I'll use some (2-4) buttons in the last row, then I could use some columns (then the rest of rows should span adequately).
So, what geometry manager would you recommend, pack or grid?
Thanks in advance.
Cheers
Mateusz Loskot
OK, it's very simple layout and I decided to use pack. It works well.
Cheers
According to all usage I've seen, grid manager is useful only when there's a high regularity of layout in both horizontal and vertical directions - think of grid as a "table manager". Managing the buttons on the calculator application is a good example of this.
In your case pack will be perfect. Learn about frames - they can be extremely useful for organizing nested hierarchies in the layout. See examples 4 and 6 on the C++/Tk web page (also as part of the distribution).
Maciej
Thanks for confirming pack as the best manager in this case. I've moved forward with my app using pack.
Mateusz