I'm working on a moderately complex project with wxPython and have
enountered some issues along the way. Maybe they're real, maybe they're
stupid people tricks, but here they are:
The app's primary interface is a taskbar icon, which is set up in my wxApp's
OnInit. However, before the taskbar icon can be used, I need to log in the
user, and the login window is a bit more complex than a simple dialog. This
produced two issues:
(1) For some reason, sizers don't work as expected with wxDialog-based
objects. The dialog included two wxStaticBoxSizers and within one of them a
bmp for a logo. What appeared to be perfectly good flags and options for
the sizers made the dialog an unreadable mess, with the controls piling up
on each other and on top of the bmp. Further, even when I was able to find
the 'magic' flags, I never could get the wxStaticBox element of the
wxStaticBoxSizers to display unless I resized the dialog.
Here's the fun part: I had constructed the object so that all I had to do
was change two lines to take it from a wxDialog class to wxFrame class. As
SOON as I did this, added a panel to the frame, and added pointed the sizers
to the panel -- everything worked *perfectly*.
So why is this? I haven't looked at the source (c) yet, but is it possible
that when we assign a sizer to a wxDialog, it's assigned to the dialog's
frame instead of its panel?
Okay, next thing: one reason I wanted to use a wxDialog in the first place
was to use the modal feature of wxDialog. Not having that, I tried out the
MakeModal() method for wxFrame. I've tried everything I can think of and it
isn't doing the trick -- IS there a trick, or is it (as the docs say) not
implemented?
Finally: what is the best way for a wxFrame-based class to communicate back
to the parent? By this I mean, I want to pass a 'user' object or at least
some sort of status back to my wxApp once I'm done. If I can't use
MakeModal, how do I get a nice orderly chain of events here?
The source code is pretty huge, but if needed....
PS: OK, actually, here's the FINALLY -- am I missing something, or is there
no way to set the state of a wxCheckBox at time of creation?
// Jeff Grimmett
// http://www.livejournal.com/users/grimmtooth/
`--------------------------------------------'