From: Mike Driscoll <mdriscoll@co.marshall.ia.us <mailto:mdriscoll@co.marshall.ia.us>>
To: wxpython-users@lists.wxwidgets.org <mailto:wxpython-users@lists.wxwidgets.org>
Date: Mon, 19 May 2008 09:05:40 -0500
Subject: Re: [wxpython-users] Sizer tutorial version 1
Great tutorial Mike!
Thanks!
One area I always seem to get stuck with sizers is adding more than one widget "one the same line", especially when they are not the same widgets, and are not symmetrical.
I usually start off with something from wxPython In Action, then try to insert the widgets I want, but most of the time it doesn't work for me, because there are too many aspects of using sizers that I'm still learning. Calling SetSizer() usually messes up my widget placement, so I just don't use it (and don't know what it's for)
SetSizer() is the way that you add a sizer to a container widget, such as a panel or frame. The wxPython in Action book talks about it on page 325. You'll notice in my tutorials that I add the top sizer to my panel because my panel contains all the other widgets. As I understand it, you should set the top sizer to the parent widget. Maybe someone else on the list can explain it better though.
I'd like to suggest a follow-on tutorial (using this as a starting point) where the several widgets are placed horizontally to each other (but also on multiple lines, as in the tutorial you've already done) , and are not the same size (and possibly, just different widgets)
Thanks
I'll try to come up with something cool that uses different sized widgets. It will probably be useless other than as a teaching tool though.
What events get raised when a control gains/loses focus?
Motivation: I would like to update a help panel when a control gains
focus. I would also like to validate some text controls after the text
control loses focus (not on a char by char basis).
Perhaps more importantly, is there a URL that contains a list of
wxPython events organized by type of control?
What events get raised when a control gains/loses focus?
The focused controls themselves get EVT_SET_FOCUS and EVT_KILL_FOCUS. The parents get EVT_CHILD_FOCUS.
Motivation: I would like to update a help panel when a control gains
focus. I would also like to validate some text controls after the text
control loses focus (not on a char by char basis).
Perhaps more importantly, is there a URL that contains a list of
wxPython events organized by type of control?
Look at the docs for the event classes.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
Of course, you can also look it up in the wxWidgets Reference thing that comes with the Docs and Demos. They're pretty hard to read since they're based on man pages, but they can be helpful nonetheless.
Finally, there's this site, which has been helpful to me in the past:
Maybe those will give you some hints...
···
--------------
Mike Driscoll
Python Extension Building Network: http:\\www.pythonlibrary.org
Blog: http:\\blog.pythonlibrary.org