- gtk_set_locale();
-
- gtk_init( &argc, &argv );
-
- if (!wxApp::Initialize())
- return -1;
-
- if (!wxTheApp)
- {
- wxCHECK_MSG( wxApp::GetInitializerFunction(), -1,
- "wxWindows error: No initializer - use IMPLEMENT_APP macro.\n" );
-
- wxAppInitializerFunction app_ini = wxApp::GetInitializerFunction();
-
- wxObject *test_app = app_ini();
-
- wxTheApp = (wxApp*) test_app;
- }
-
- wxCHECK_MSG( wxTheApp, -1, "wxWindows error: no application object" );
-
- wxTheApp->argc = argc;
- wxTheApp->argv = argv;
-
- char name[200];
- strcpy( name, argv[0] );
- strcpy( name, wxFileNameFromPath(name) );
- wxStripExtension( name );
- wxTheApp->SetAppName( name );
-
- if (!wxTheApp->OnInitGui())
- return 0;
-
- /* Here frames insert themselves automatically
- * into wxTopLevelWindows by getting created
- * in OnInit(). */
-
- if (!wxTheApp->OnInit())
- return 0;
-
- wxTheApp->m_initialized = wxTopLevelWindows.GetCount() != 0;
-
- int retValue = 0;
-
- if (wxTheApp->Initialized())
- retValue = wxTheApp->OnRun();
-
- wxWindow *topWindow = wxTheApp->GetTopWindow();
- if (topWindow)