Exploring Python for next desktop GUI Project

Michael Torrie torriem at gmail.com
Thu Jul 24 23:38:20 CEST 2014


On 07/24/2014 10:46 AM, Chris Angelico wrote:
> On Fri, Jul 25, 2014 at 2:29 AM, Noble Bell <noblebell at gmail.com> wrote:
>> I was leaning toward Python 3 and Tkinter. I suppose the best way to do the GUI with Tkinter is to just roll-up my sleeves and do it via code rather than with the aid of a GUI editor.
> 
> Yep. In fact, I recommend that for all GUI toolkits; instead of
> thinking about your layout in terms of positions of widgets on a
> window, think about it in terms of what your toolkit provides you with
> - usually that'll be some kind of tree structure of layout objects,
> like vertical and horizontal boxes. And if you plan your layout that
> way, you may as well just write it directly as code.

As an exercise, yes this is valuable, but not necessary as a matter of
course. But I rarely code guis anymore.  I use Qt Designer for Qt apps,
and Glade-3 for GTK and then load the resulting XML into my app at
runtime.  The GUI designers expose the full layout management
capabilities of the toolkit.  In GTK terms that's generally hboxes or
vboxes with expansion flags.  In Qt it's the same but with "springs" to
consume space to make things grow and shrink appropriately.



More information about the Python-list mailing list