Hello Daniel,
I had a question. I have a frame and some menus with menubar.
For each click of any menu item I open up a new Frame. So my main fran
essentially does nothing except for displaying the menubar and menus.
Any hints how to make your main frame usable for other functionality.
Well, you may have a lot of options... let's see if I am able to
describe what I would do in your place:
1) If I don't have too many menus from which the user can choose, I
would eliminate most of the menus and place all the options in a
wx.Notebook inside the main frame. In this way, the old frames are
"transformed" into panels and put into the notebook. However, if a
notebook has too many tabs, it becomes annoying;
2) Suppose I don't like the notebook approach. I could use a
wx.MDIFrame, which looks empty until your user create a new frame (by
choosing from the menus). This new frame is placed inside the client
area of the MDI frame, so you main frame will look more "populated"
Microsoft is saying from years that MDI things are deprecated. I find
them useful for heavy visualization apps (such as VTK and/or
Matplotlib). IIRC, MDI things are more problematic on other platforms
than Windows, but I may be wrong here;
3) Use an overall sizer: every time the user choose from a menu, you
hide the previous panel (if it exist) by calling sizer.Show(False),
you create a new panel that contains all the widgets you need and add
it to the sizer. If the panel already exists, you can just call
sizer.Show();
4) Use some more "advanced" layout manager, such as PyAUI, that allows
you to float/dock/show/hide almost whatever you want. PyAUI may be a
little bit hard at the beginning, but now I always use it for all the
applications I build for my work.
There are surely other possibilities, but... just my 2c.
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.virgilio.it/infinity77/