+ wxASSERT( visual );
+
+ return visual;
+}
+
+bool wxApp::Initialize(int& argc, wxChar **argv)
+{
+ if ( !wxAppBase::Initialize(argc, argv) )
+ return false;
+
+#if wxUSE_THREADS
+ if (!g_thread_supported())
+ g_thread_init(NULL);
+
+ wxgs_poll_func = g_main_context_get_poll_func(NULL);
+ g_main_context_set_poll_func(NULL, wxapp_poll_func);
+#endif // wxUSE_THREADS
+
+ // We should have the wxUSE_WCHAR_T test on the _outside_
+#if wxUSE_WCHAR_T
+ // gtk+ 2.0 supports Unicode through UTF-8 strings
+ wxConvCurrent = &wxConvUTF8;
+#else // !wxUSE_WCHAR_T
+ if (!wxOKlibc())
+ wxConvCurrent = (wxMBConv*) NULL;
+#endif // wxUSE_WCHAR_T/!wxUSE_WCHAR_T
+
+ // decide which conversion to use for the file names
+
+ // (1) this variable exists for the sole purpose of specifying the encoding
+ // of the filenames for GTK+ programs, so use it if it is set
+ wxString encName(wxGetenv(_T("G_FILENAME_ENCODING")));
+ encName = encName.BeforeFirst(_T(','));
+ if (encName.CmpNoCase(_T("@locale")) == 0)
+ encName.clear();
+ encName.MakeUpper();
+#if wxUSE_INTL
+ if (encName.empty())