Tkinter vs wxPython: your opinions?
Rick Lee
rwklee at home.com
Sat Jan 27 16:55:33 EST 2001
I probably misled quite a few readers with what I meant by "description of an
object's attributes". I don't mean an object's geometry attributes. I mean the
object of interest to the user, for example, a person's wallet, whose possible
description could be:
- compartments and pockets; within each, either bank notes, or cards; for bank
notes, number of notes and denomination of each; for each card, thickness,
weight, colour.
I like the GUI toolkit to be able to take an description like this, and generate
a nice looking window to display this structured information; as well as to
allow the user to change data, including, in the above example, adding/deleting
compartments, bank notes, cards.
Christian Tanzer wrote:
> rwklee at home.com wrote :
>
> > Thank you all for your thoughtful posts. On reflection, I would say my
> > greatest need would be:
> >
> > - being able to build data entry screens on the fly from a description of
> > an object's attributes
> >
> > I am still very naive about this; but I would have thought the need for
> > this feature would crop up frequently. I wonder why it doesn't seem to be
> > featured in the popular toolkits. Maybe it is extremely easy for anyone to
> > build, in which case would someone care to post a working example. Thanks.
>
> Sorry, I can't easily post working code.
>
> But your problem is easy to solve if you use a good geometry manager,
> like Tkinter's pack or grid (grid being my preferred solution).
>
> For Tkinter, it looks like:
>
> body = Frame (...)
> entries = []
> for entry_desc in «description of an object's attributes» :
> label = Label (master = body, text = entry_desc.name, ...)
> entry = Entry (master = body, ...)
> label.grid (column = 0, row = len (entries), ...)
> entry.grid (column = 1, row = len (entries), ...)
> entries.append (entry)
> body.grid_columnconfigure (0, weight = 1, minsize = ...)
> body.grid_columnconfigure (1, weight = 5, minsize = ...)
> boy.pack (...)
>
> Shouldn't be any harder for a different toolkit, as long as it
> offers decent geometry management.
>
> --
> Christian Tanzer tanzer at swing.co.at
> Glasauergasse 32 Tel: +43 1 876 62 36
> A-1130 Vienna, Austria Fax: +43 1 877 66 92
More information about the Python-list
mailing list