[Python-Dev] PEP 343 - Abstract Block Redux

Ka-Ping Yee python-dev at zesty.ca
Mon May 16 00:54:44 CEST 2005


On Sun, 15 May 2005, Shane Hathaway wrote:
> You might add to the PEP the following example, which could really
> improve the process of building GUIs in Python:
>
>     class MyFrame(Frame):
>         def __init__(self):
>             with Panel():
>                 with VerticalBoxSizer():
>                     self.text = TextEntry()
>                     self.ok = Button('Ok')

I don't understand how this would be implemented.  Would a widget
function like 'TextEntry' set the parent of the widget according to
some global 'parent' variable?  If so, how would 'Panel' know that
its parent is supposed to be the 'MyFrame' object?


-- ?!ng


More information about the Python-Dev mailing list