Make wxSplashScreen with parent so it ends immediatelly if we close main frame very quickly.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28641 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -118,19 +118,19 @@ bool MyApp::OnInit()
|
|||||||
{
|
{
|
||||||
wxImage::AddHandler(new wxPNGHandler);
|
wxImage::AddHandler(new wxPNGHandler);
|
||||||
|
|
||||||
|
// create the main application window
|
||||||
|
MyFrame *frame = new MyFrame(_T("wxSplashScreen sample application"));
|
||||||
|
|
||||||
wxBitmap bitmap;
|
wxBitmap bitmap;
|
||||||
if (bitmap.LoadFile(_T("splash.png"), wxBITMAP_TYPE_PNG))
|
if (bitmap.LoadFile(_T("splash.png"), wxBITMAP_TYPE_PNG))
|
||||||
{
|
{
|
||||||
new wxSplashScreen(bitmap,
|
new wxSplashScreen(bitmap,
|
||||||
wxSPLASH_CENTRE_ON_SCREEN|wxSPLASH_TIMEOUT,
|
wxSPLASH_CENTRE_ON_SCREEN|wxSPLASH_TIMEOUT,
|
||||||
6000, NULL, wxID_ANY, wxDefaultPosition, wxDefaultSize,
|
6000, frame, wxID_ANY, wxDefaultPosition, wxDefaultSize,
|
||||||
wxSIMPLE_BORDER|wxSTAY_ON_TOP);
|
wxSIMPLE_BORDER|wxSTAY_ON_TOP);
|
||||||
}
|
}
|
||||||
wxYield();
|
wxYield();
|
||||||
|
|
||||||
// create the main application window
|
|
||||||
MyFrame *frame = new MyFrame(_T("wxSplashScreen sample application"));
|
|
||||||
|
|
||||||
// and show it (the frames, unlike simple controls, are not shown when
|
// and show it (the frames, unlike simple controls, are not shown when
|
||||||
// created initially)
|
// created initially)
|
||||||
frame->Show(true);
|
frame->Show(true);
|
||||||
|
Reference in New Issue
Block a user