// create the main application window
LifeFrame *frame = new LifeFrame();
- // show it and tell the application that it's our main window
+ // show it
frame->Show(true);
- SetTopWindow(frame);
// just for Motif
#ifdef __WXMOTIF__
@e OnInit will usually create a top window as a bare minimum. Unlike in earlier
versions of wxWidgets, OnInit does not return a frame. Instead it returns a
boolean value which indicates whether processing should continue (@true) or not
-(@false). You call wxApp::SetTopWindow to let wxWidgets know about the top
-window.
+(@false).
Note that the program's command line arguments, represented by @e argc and
@e argv, are available from within wxApp member functions.
wxFrame *the_frame = new wxFrame(NULL, ID_MYFRAME, argv[0]);
...
the_frame->Show(true);
- SetTopWindow(the_frame);
return true;
}
{
MyFrame *frame = new MyFrame( "Hello World", wxPoint(50,50), wxSize(450,340) );
frame->Show( true );
- SetTopWindow( frame );
return true;
}
@endcode
62: frame = MyFrame(NULL, -1, "This is a test")
63: frame.Show(true)
64:
-65: # Tell wxWidgets that this is our main window
-66: self.SetTopWindow(frame)
67:
68: # Return a success flag
69: return true
Just like wxWidgets in C++, wxPython apps need to create a class derived from
@c wxApp (line 56) that implements a method named @c OnInit, (line 59.) This
-method should create the application's main window (line 62) and use
-wxApp.SetTopWindow() (line 66) to inform wxWidgets about it.
+method should create the application's main window (line 62) and show it.
And finally, at line 72 an instance of the application class is created. At
this point wxPython finishes initializing itself, and calls the @c OnInit
wxDEFAULT_FRAME_STYLE);
frame->Show(true);
- SetTopWindow(frame);
-
return true;
}
wxT("wxAUI Sample Application"),
wxDefaultPosition,
wxSize(800, 600));
- SetTopWindow(frame);
frame->Show();
return true;
// create the main program window
MyFrame *frame = new MyFrame;
frame->Show(true);
- SetTopWindow(frame);
// use our config object...
if ( pConfig->Read(wxT("/Controls/Check"), 1l) != 0 ) {
MyFrame *frame =
new MyFrame(NULL, "wxDataViewCtrl sample", 40, 40, 1000, 540);
- SetTopWindow(frame);
frame->Show(true);
return true;
MyFrame *frame = new MyFrame(wxT("Dial-up wxWidgets demo"),
wxPoint(50, 50), wxSize(450, 340));
- // Show it and tell the application that it's our main window
+ // Show it
frame->Show(true);
- SetTopWindow(frame);
// Init dial up manager
m_dial = wxDialUpManager::Create();
frame->Centre();
frame->Show();
- SetTopWindow(frame);
return true;
}
MyFrame *frame = new MyFrame(wxT("Drawing sample"),
wxDefaultPosition, wxSize(550, 840));
- // Show it and tell the application that it's our main window
+ // Show it
frame->Show(true);
- SetTopWindow(frame);
if ( !LoadImages() )
{
MyFrame *frame = new MyFrame(wxT("Exec wxWidgets sample"),
wxDefaultPosition, wxSize(500, 140));
- // Show it and tell the application that it's our main window
+ // Show it
frame->Show(true);
- SetTopWindow(frame);
// success: wxApp::OnRun() will be called which will enter the main message
// loop and the application will run. If we returned false here, the
MyFrame *frame = new MyFrame(wxT("Font wxWidgets demo"),
wxPoint(50, 50), wxSize(600, 400));
- // Show it and tell the application that it's our main window
+ // Show it
frame->Show(true);
- SetTopWindow(frame);
// success: wxApp::OnRun() will be called which will enter the main message
// loop and the application will run. If we returned 'false' here, the
#endif // !USE_SIMPLE_HELP_PROVIDER
frame->Show(true);
- SetTopWindow(frame);
// initialise the help system: this means that we'll use doc.hlp file under
// Windows and that the HTML docs are in the subdirectory doc for platforms
MyFrame *frame = new MyFrame(_("HTML Help Sample"),
wxDefaultPosition, wxDefaultSize);
- // Show it and tell the application that it's our main window
- // @@@ what does it do exactly, in fact? is it necessary here?
+ // Show it
frame->Show(true);
- SetTopWindow(frame);
-
// success: wxApp::OnRun() will be called which will enter the main message
// loop and the application will run. If we returned false here, the
MyFrame *frame = new MyFrame(_("Printing test"),
wxDefaultPosition, wxSize(640, 480));
- // Show it and tell the application that it's our main window
- // @@@ what does it do exactly, in fact? is it necessary here?
+ // Show it
frame->Show(true);
- SetTopWindow(frame);
-
// success: wxApp::OnRun() will be called which will enter the main message
// loop and the application will run. If we returned false here, the
MyFrame *frame = new MyFrame(_("wxHtmlWindow testing application"),
wxDefaultPosition, wxSize(640, 480));
- // Show it and tell the application that it's our main window
- // @@@ what does it do exactly, in fact? is it necessary here?
+ // Show it
frame->Show(true);
- SetTopWindow(frame);
+
wxFileSystem::AddHandler(new MyVFS);
// success: wxApp::OnRun() will be called which will enter the main message
MyFrame *frame = new MyFrame( _("wxHtmlWindow testing application"),
wxDefaultPosition, wxSize(640, 480) );
- // Show it and tell the application that it's our main window
- // @@@ what does it do exactly, in fact? is it necessary here?
+ // Show it
frame->Show(true);
- SetTopWindow(frame);
// success: wxApp::OnRun() will be called which will enter the main message
// loop and the application will run. If we returned false here, the
MyFrame *frame = new MyFrame(_("wxHtmlWindow testing application"),
wxDefaultPosition, wxSize(640, 480) );
- // Show it and tell the application that it's our main window
- // @@@ what does it do exactly, in fact? is it necessary here?
+ // Show it
frame->Show(true);
- SetTopWindow(frame);
// success: wxApp::OnRun() will be called which will enter the main message
// loop and the application will run. If we returned false here, the
// Show the frame
frame->Show(true);
- SetTopWindow(frame);
return true;
}
frame->CenterOnScreen();
frame->Show(true);
- SetTopWindow(frame);
-
return true;
}
// Show the frame
frame->Show(true);
- SetTopWindow(frame);
-
return true;
}
frame->SetStatusText(wxT("Welcome to wxWidgets menu sample"));
#endif // wxUSE_STATUSBAR
- SetTopWindow(frame);
-
return true;
}
frame->panel = new wxWindow(frame, wxID_ANY, wxPoint(0, 0), wxSize(400, 400), 0, wxT("MyMainFrame"));
frame->Show(true);
- // Return the main frame window
- SetTopWindow(frame);
-
return true;
}
// Create the main window
MyFrame *frame = new MyFrame();
- SetTopWindow(frame);
// Problem with generic wxNotebook implementation whereby it doesn't size
// properly unless you set the size again
MyFrame *frame = new MyFrame(wxT("OleAuto wxWidgets App"),
wxPoint(50, 50), wxSize(450, 340));
- // Show it and tell the application that it's our main window
- // @@@ what does it do exactly, in fact? is it necessary here?
+ // Show it
frame->Show(true);
- SetTopWindow(frame);
// success: wxApp::OnRun() will be called which will enter the main message
// loop and the application will run. If we returned false here, the
return false;
// Create the main frame window
- SetTopWindow(new MyFrame(NULL, wxT("wxWidgets OpenGL Isosurf Sample")));
+ MyFrame *frame = new MyFrame(NULL, wxT("wxWidgets OpenGL Isosurf Sample"));
return true;
}
= new OwnerDrawnFrame(NULL, wxT("wxWidgets Ownerdraw Sample"),
50, 50, 450, 340);
- SetTopWindow(pFrame);
-
return true;
}
frame->Centre(wxBOTH);
frame->Show();
- SetTopWindow(frame);
-
return true;
}
RegFrame *frame = new RegFrame(NULL, wxT("wxRegTest"), 50, 50, 600, 350);
frame->Show(true);
- SetTopWindow(frame);
-
return true;
}
return false;
wxFrame* frame = new MyFrame;
- SetTopWindow(frame);
frame->Show();
return true;
frame->Show(true);
- SetTopWindow(frame);
-
return true;
}
// Create the main application window
MyFrame *frame = new MyFrame();
- // Show it and tell the application that it's our main window
+ // Show it
frame->Show(true);
- SetTopWindow(frame);
// success
return true;
// Create the main application window
MyFrame *frame = new MyFrame();
- // Show it and tell the application that it's our main window
+ // Show it
frame->Show(true);
- SetTopWindow(frame);
// Success
return true;
// open application frame
m_frame->Layout ();
m_frame->Show (true);
- SetTopWindow (m_frame);
return true;
}
frame->Show(true);
- SetTopWindow(frame);
-
return true;
}
frame->Show(true);
- SetTopWindow(frame);
-
// report success
return true;
}
wxInitAllImageHandlers();
- SetTopWindow(frame);
-
return true;
}
// Show the frame
frame->Show(true);
- SetTopWindow(frame);
return true;
}
// Show the frame
frame->Show(true);
- SetTopWindow(frame);
-
return true;
}
MyFrame *frame = new MyFrame((wxFrame *) NULL, wxT("Validator Test"),
50, 50, 300, 250);
frame->Show(true);
- SetTopWindow(frame);
+
return true;
}