[wxPython] Using wxSizers

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[wxPython] Using wxSizers

Joseph Martin-3
Hello,
        I am new to wxPython/wxGTK (just downloaded and compiled it
last week.) I love the code and plan on using it extensively. This
could be just the thing to convert my co-workers from
VisBasic.
        Anyway, as a way to learn wxPython I decided to write a GUI
frontend for an app I use (also written in Python). After reading a
bit I decided I wanted to use wxSizers to lay out my GUI. I found the
wxWindows docs for wxSizers, but the equivalent docs for
wxPython. From what I can tell the wxPython implementation is
different from the wxWindows implementation. The code I have written
doesn't really work. The GUI elements get all squashed together
instead of being neatly layed out like I would expect. I am including
my code. If anyone can point out my errors and offer a solution I
would greatly appreciate it.

Thanks,
joseph

p.s. this message may show up twice. the first time I had my return
address configured wrong and the mailing list thought I was an
unsubscribed poster. Not true. I have fixed my return address now.

--
[hidden email]

All opinions expressed are my own and not necessarily those of
my employer unless otherwise noted.

album.py (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [wxPython] Using wxSizers

Robin Dunn
> Anyway, as a way to learn wxPython I decided to write a GUI
> frontend for an app I use (also written in Python). After reading a
> bit I decided I wanted to use wxSizers to lay out my GUI. I found the
> wxWindows docs for wxSizers, but the equivalent docs for
> wxPython. From what I can tell the wxPython implementation is
> different from the wxWindows implementation.

Yep, currently the sizers in wxPython are different because they existed
first in Python and then got ported to C++.  Both versions will be available
in the next release which will happen in a day or two if all goes well.


> The code I have written
> doesn't really work. The GUI elements get all squashed together
> instead of being neatly layed out like I would expect. I am including
> my code. If anyone can point out my errors and offer a solution I
> would greatly appreciate it.
>


The problem is your OnSize method.  It needs to be defined with (self,
event) instead of just ().

--
Robin Dunn
Software Craftsman
[hidden email]
http://AllDunn.com/robin/
http://AllDunn.com/wxPython/  Check it out!









_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users