- /* GTK 1.2 up to version 1.2.3 has broken threads */
- if ((gtk_major_version == 1) &&
- (gtk_minor_version == 2) &&
- (gtk_micro_version < 4))
- {
- printf( "wxWindows warning: GUI threading disabled due to outdated GTK version\n" );
- }
- else
- {
- g_thread_init(NULL);
- }
-#endif
-
- gtk_set_locale();
-
-#if wxUSE_WCHAR_T
- if (!wxOKlibc()) wxConvCurrent = &wxConvLocal;
-#else
- if (!wxOKlibc()) wxConvCurrent = (wxMBConv*) NULL;
-#endif
-
- gdk_threads_enter();
-
- gtk_init( &argc, &argv );
-
- wxSetDetectableAutoRepeat( TRUE );
-
- if (!wxApp::Initialize())
- {
- gdk_threads_leave();
- return -1;
- }
-
- if (!wxTheApp)
- {
- wxCHECK_MSG( wxApp::GetInitializerFunction(), -1,
- wxT("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, wxT("wxWindows error: no application object") );
-
- wxTheApp->argc = argc;
-#if wxUSE_UNICODE
- wxTheApp->argv = new wxChar*[argc+1];
- int mb_argc = 0;
- while (mb_argc < argc)
- {
- wxTheApp->argv[mb_argc] = wxStrdup(wxConvLibc.cMB2WX(argv[mb_argc]));
- mb_argc++;
- }
- wxTheApp->argv[mb_argc] = (wxChar *)NULL;
-#else
- wxTheApp->argv = argv;