GUI toolkits with Tkinter's .pack() alternative

Guilherme Polo ggpolo at gmail.com
Thu Mar 27 12:31:03 CET 2008


2008/3/27, Alex9968 <noname9968 at gmail.com>:
> Guilherme Polo wrote:
>  > 2008/3/27, Alex9968 <noname9968 at gmail.com>:
>  >
>  >> Guilherme Polo wrote:
>  >>  > 2008/3/26, Alex9968 <noname9968 at gmail.com>:
>  >>  >
>  >>  >> Hi all,
>  >>  >>
>  >>  >>  I use Tkinter's Pack widget geometry manager (I really prefer it over
>  >>  >>  using visual GUI designers), so my question is which other GUI toolkits
>  >>  >>  have similar functionality.
>  >>  >>
>  >>  >
>  >>  > The geometry manager isn't related to using GUI designers tools at
>  >>  > all. And each toolkit has it's own way to do the things, wxPython uses
>  >>  > sizers, PyGtk uses containers.
>  >>  >
>  >>
>  >> Well, the geometry manager isn't *directly* related to using GUI
>  >>  designers, but as Pack arranges widgets automatically, using GUI
>  >>  designers isn't required, while with geometry managers that don't, GUI
>  >>  designers are necessary (if you start placing widgets programmatically,
>  >>  you'll end up reinventing something like Tkinter's Pack or Grid geometry
>  >>  manager). I hope I can be understood clearly this time ;-)
>  >>
>  >
>  > Not at all, can't understand your point yet. GUI designers aren't just
>  > for placing widgets, they also will keep the interface design
>  > separated from your code.
>  >
>
> I do not want to separate interface from code and I do not experience
>  the need to use GUI designers.
>

It is your opinion, it seems I can't change it for now but I hope you
reconsider it for the future.

>  Pack arranges widgets perfectly, and it's very complex to do the same
>  without it, both in code and in GUI designer.

For some level of "perfect", of course.
Also, I can't understand why you say it is hard to do such thing in a
gui designer tool, which tool have you tried ? Maybe you are not
familiar with them yet, and that could be the problem.

> I wish toolkits I use to
> be able to place widgets one after another automatically.
>

They all make this possible, you could try doing something on another
toolkit you are interested and check if it does what you want.

> >
>  >>>>  Secondly, I like the detailed widget borders configuration possible in
>  >>>>
>  >>  >>  Tkinter, which can be used to tweak GUI look, and wonder if other
>  >>  >>  toolkits support it. With Tkinter's case, I like the resulting (tweaked)
>  >>  >>  look in Windows, but I'm afraid it can be quite different (and ugly) on
>  >>  >>  other platforms.
>  >>  >>
>  >>  >
>  >>  > You sure can, but differently.
>  >>  >
>  >>
>  >> I suppose any toolkit allows setting parameters like "no border", "flat
>  >>  border" and "3d border", but which ones can set ANY type of border to
>  >>  ANY widget like Tkinter does? For example set GROOVE border to buttons
>  >>  and text widgets (instead of traditional wide raised/lowered borders),
>  >>  which is cool (in my opinion).
>  >>
>  >>
>  >
>  > The widgets subclass some base class, which contains some common
>  > methods which could be the border and relief for example.
>  > In the case of PyGtk, border
>  > width is controlled at Container, so most widgets will have this
>  > feature, but the relief style of the widget is not common to all
>  > widgets so you will need to check this one (Button has it).
>  > In wxPython, widgets will subclass Window, which has all you want and more.
>  > But PyQt doesn't seem to care much about this, you can change the
>  > widget to flat (if it makes sense to that widget have setFlat method)
>  > but not much related to the borders.
>  > You could recheck your use-cases and see if they are acceptable.
>  >
>  >
>  >>  >>  (The reason I ever consider moving from Tkinter is some inconveniences,
>  >>  >>  involving for example window scrolling, plus its smaller amount of
>  >>  >>  widgets compared to some other toolkits, plus its (rumored) ugly look on
>  >>  >>  certain environments. I will not necessary change the toolkit, but I
>  >>  >>  have to consider it)
>  >>  >>
>  >>  >>
>  >>  >
>  >>  > I'm planning to "solve" this, I'm suggesting inclusion of Ttk into
>  >>  > Tkinter for upcoming GSoC. For now you could try using Tile extension,
>  >>  > and update to Tk 8.5. If you don't want to use extensions, then you
>  >>  > will have to wait or change the toolkit for now.
>  >>  >
>  >>
>  >> Thanks. I haven't heard of Tile before, now I will keep this in mind.
>  >>  You forgot to mention WHAT you're planning to solve ;-) , so I have to
>  >>  add that Tile is modernization of Tk widgets (so it fixes ugly look).
>  >>
>  >>
>  >
>  > WHAT I'm planning to solve, quote from my own paragraph:
>  > "I'm planning to "solve" this, I'm suggesting inclusion of Ttk into
>  > Tkinter for upcoming GSoC."
>  >
>  > I would like to add the possibility to use Ttk widgets into tkinter,
>  > providing you have Tk 8.5. It would solve the problem of "not enough
>  > widgets" and the other one of "being ugly" mainly. Tk 8.5 also
>  > auto-fixes some other problems, it provides smooth-scrolling for the
>  > text widget, for example. But keep in mind that using Tk 8.5 in Python
>  > is not yet supported (but possible).
>  >
>
> I understood you. I added that sentence just to make it clear for anyone
>  reading this. Your participation is appreciated greatly, thank you.
>


-- 
-- Guilherme H. Polo Goncalves



More information about the Python-list mailing list