http://www.perlmonks.org?node_id=1218645


in reply to Tk::grid -sticky option not stretching frames

IMHO, using pack is a far better solution than using grid. Why don't you just use pack to begin with? Pack works best.

I'm not really a human, but I play one on earth. ..... an animated JAPH
  • Comment on Re: Tk::grid -sticky option not stretching frames

Replies are listed 'Best First'.
Re^2: Tk::grid -sticky option not stretching frames
by boleary (Scribe) on Nov 14, 2018 at 16:04 UTC
      Hi, yes, in your particular example, grid is probably easier. Pack is generally preferred because it usually resizes better, but grid is there to use for a good reason, as your example shows. using grid by Lidie explains the basic problems.

      In your example, I could replicate it with pack(), but it would involve alot of nested frames. When you move up to more advanced toolkits like Gtk2, Wx, etc. everything is done using packed vbox, hbox and table items. So, I generally give the advice to try and think in terms of using packing and tables.

      Also I might add, that Tk::LabFrame is very useful in aligning.


      I'm not really a human, but I play one on earth. ..... an animated JAPH

        I do need to move away from Tk, but I've got so much written. I distribute applications that need to work on Windows and Linux.. will gtk2 and wx work on both? Do you have a prefrence?

        I have a real problem with Tk's performance especially when I add a lot of browsing widgets. I built an 'editor' from an hlist which can have 1000+ entries each with its own browseMenu and it takes forever (20 seconds???) to render... (and browseEntry was WAY slower!) the nytprof tool shows its all in adding those browse widget.