- gtk_set_locale();
-
- if (!wxOKlibc()) wxConv_current = &wxConv_local;
-
- gtk_init( &argc, &argv );
-
- wxSetDetectableAutoRepeat( TRUE );
-
- if (!wxApp::Initialize())
- return -1;
-
- if (!wxTheApp)
- {
- wxCHECK_MSG( wxApp::GetInitializerFunction(), -1,
- _T("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, _T("wxWindows error: no application object") );
-
- wxTheApp->argc = argc;
- wxTheApp->argv = argv;
-
- wxString name(wxFileNameFromPath(argv[0]));
- wxStripExtension( name );
- wxTheApp->SetAppName( name );
-
- int retValue = 0;
-
- if ( !wxTheApp->OnInitGui() )
- retValue = -1;