Help with wxPython BoxSizers

Lexy Zhitenev zhitenev at cs.vsu.ru
Tue Mar 4 11:31:45 EST 2003


Look carefully into this Python code:

"Miki Tebeka" <tebeka at cs.bgu.ac.il> wrote in message:
news:33803989.0303040753.1c47eefc at posting.google.com...
<wink>
> class Client(wxFrame):
>     def __init__(self, parent, id):
>         wxFrame.__init__(self, parent, id, 'Compass Client')
>         topsizer = wxBoxSizer(wxVERTICAL)
>         # Top Read Data button
>         b = wxButton(self, ID_READ_DATA, 'Read Data')
>         EVT_BUTTON(self, ID_READ_DATA, self.on_read_data)
>         topsizer.Add(b)
>         # Defect file
>         #FIXME: Why doesn't layout work?
>         topsizer.Add(wxStaticText(self, -1, 'Defect file:'))
>         hsizer = wxBoxSizer(wxHORIZONTAL)
>         self.defect = \
>             wxTextCtrl(self, ID_DEFECT, '', size=(200, -1))
>         hsizer.Add(self.defect)
>         b = wxButton(self, ID_BROWSE, '...', size=(20, -1))
>         hsizer.Add(b)
>         topsizer.Add(hsizer)
>         EVT_BUTTON(self, ID_BROWSE, self.on_select_defect)
>         topsizer.Add(b)

!!! The above line should be deleted !!!

>
>         q = wxButton(self, ID_QUIT, 'Quit', wxPoint(0, 70))
>         EVT_BUTTON(self, ID_QUIT, lambda e: self.Close(1))
>         topsizer.Add(q)

<wink>

Regards, Lexy.






More information about the Python-list mailing list