Menu

Best geometry manager for my simple problem

Help
2006-04-08
2013-04-15
  • Mateusz Loskot

    Mateusz Loskot - 2006-04-08

    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

     
    • Mateusz Loskot

      Mateusz Loskot - 2006-04-15

      OK, it's very simple layout and I decided to use pack. It works well.
      Cheers

       
    • Maciej Sobczak

      Maciej Sobczak - 2006-04-24

      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

       
      • Mateusz Loskot

        Mateusz Loskot - 2006-04-27

        Thanks for confirming pack as the best manager in this case. I've moved forward with my app using pack.

        Mateusz

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.