up with PyGUI!
Hans Nowak
hans at zephyrfalcon.org
Thu Sep 23 16:25:31 EDT 2004
Nicolas Fleury wrote:
> Hans Nowak wrote:
>
>> I'm not sure it's *that* much easier... all you're saving is one
>> parameter.
>
>
> Easier is probably not the good word. It is less redundant and less
> error-prone. It has happened to me to make mistakes in ownership of
> widgets when copy-pasting code, when these errors would not have occured
> if the parent parameter was not passed.
Admittedly, having to state the parent-child (or container-child) relationship
twice is redundant. I am still thinking of ways to make that work better.
Maybe I'll post some suggestions on my weblog, so people can discuss it there,
rather than on the newsgroup.
> It is also more usable, since you can do things like:
> myFrame.SetMenuBar(MenuBar([
> Menu("File", [
> Item("&New\tCtrl+N", self.onNew),
> Menu("Some sub menu...", ...)]
> Menu("Edit", ...)]
In fact, a nested list would suffice here to contain the structure of the whole
menu. I have an application that uses just that. Maybe something that can be
added as well.
> The problem is that that explicit cross-referencing between parent and
> child forces the parent to be created before, removing capabilities like
> that one.
But adding capabilities as well... see my example in a previous post.
Cheers,
--
Hans Nowak (hans at zephyrfalcon.org)
http://zephyrfalcon.org/
More information about the Python-list
mailing list