Multiple frames
German C. Basisty
german.basisty at eipsistemas.ath.cx
Fri Nov 17 17:48:05 PST 2006
Hi!
My name is German, I'm new to wxWidgets, and I actually have a question
for you if you may help:
I'm making some experience with wxWindows, and I want to write some app
which should handle with 2 frames. For that pourpose, I wrote 2 classes
derived from wxFrame: MainFrame and SecondFrame and another class to
make the program run (DECLARE_APP and IMPLEMENT_APP stuff). Those are
very very simple and basic frames. When the program starts, it shows the
MainFrame just like on the examples; very nice :)
Then I added a menu bar, a menu and everything needed (event table, etc)
The menu is working fine.
Then, I added a private member to the Mainframe like this:
private:
SecondFrame *frame2;
and when the user clicks on some menu, it calls a function that should
show frame 2. The code seems like following:
SecondFrame *frame2 = new SecondFrame();
frame2 -> Show(TRUE);
SetTopWindow(frame2);
But it does not work :) It doesn't even compile.
How should I do to make a frame "call" (or better show) another frame
(without using MDI)?
Bests regards,
German
More information about the wx-users
mailing list