X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/42447c4f88d5519d1f7109d51d4874bbee60a360..e4de825ee6f3f991e2aa86159d6e3457afb6a8e0:/samples/help/demo.cpp diff --git a/samples/help/demo.cpp b/samples/help/demo.cpp index 34fd0eb0f8..74574c239f 100644 --- a/samples/help/demo.cpp +++ b/samples/help/demo.cpp @@ -223,7 +223,7 @@ enum HelpDemo_Help_GNOME, HelpDemo_Help_Netscape, // controls start here (the numbers are, of course, arbitrary) - HelpDemo_Text = 1000, + HelpDemo_Text = 1000 }; // ---------------------------------------------------------------------------- @@ -287,6 +287,9 @@ IMPLEMENT_APP(MyApp) // `Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // Create a simple help provider to make SetHelpText() do something. // Note that this must be set before any SetHelpText() calls are made. #if USE_SIMPLE_HELP_PROVIDER @@ -708,10 +711,7 @@ MyModalDialog::MyModalDialog(wxWindow *parent) sizerTop->Add(text, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); sizerTop->Add(sizerRow, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - SetSizer(sizerTop); - - sizerTop->SetSizeHints(this); - sizerTop->Fit(this); + SetSizerAndFit(sizerTop); btnOK->SetFocus(); btnOK->SetDefault();