+ XtSetLanguageProc(NULL, NULL, NULL);
+ XtToolkitInitialize() ;
+ wxTheApp->m_appContext = (WXAppContext) XtCreateApplicationContext();
+
+ static char *fallbackResources[] = {
+ // better defaults for CDE under Irix
+ //
+ // TODO: do something similar for the other systems, the hardcoded defaults
+ // below are ugly
+#ifdef __SGI__
+ wxMOTIF_STR("*sgiMode: True"),
+ wxMOTIF_STR("*useSchemes: all"),
+#else // !__SGI__
+#if !wxMOTIF_USE_RENDER_TABLE
+ wxMOTIF_STR("*.fontList: -*-helvetica-medium-r-normal-*-*-120-*-*-*-*-*-*"),
+#else
+ wxMOTIF_STR("*wxDefaultRendition.fontName: -*-helvetica-medium-r-normal-*-*-120-*-*-*-*-*-*"),
+ wxMOTIF_STR("*wxDefaultRendition.fontType: FONT_IS_FONTSET"),
+ wxMOTIF_STR("*.renderTable: wxDefaultRendition"),
+#endif
+ wxMOTIF_STR("*listBox.background: white"),
+ wxMOTIF_STR("*text.background: white"),
+ wxMOTIF_STR("*comboBox.Text.background: white"),
+ wxMOTIF_STR("*comboBox.List.background: white"),
+#endif // __SGI__/!__SGI__
+ NULL
+ };
+ XtAppSetFallbackResources((XtAppContext) wxTheApp->m_appContext, fallbackResources);
+
+ // we shouldn't pass empty application/class name as it results in
+ // immediate crash inside XOpenIM() (if XIM is used) under IRIX
+ wxString appname = wxTheApp->GetAppName();
+ if ( appname.empty() )
+ appname = wxT("wxapp");
+ wxString clsname = wxTheApp->GetClassName();
+ if ( clsname.empty() )
+ clsname = wxT("wx");
+
+ // FIXME-UTF8: This code is taken from wxGTK and duplicated here. This
+ // is just a temporary fix to make wxX11 compile in Unicode
+ // build, the real fix is to change Initialize()'s signature
+ // to use char* on Unix.
+#if wxUSE_UNICODE
+ // XtOpenDisplay() wants char*, not wchar_t*, so convert
+ int i;
+ char **argvX11 = new char *[argc + 1];
+ for ( i = 0; i < argc; i++ )
+ {
+ argvX11[i] = strdup(wxConvLibc.cWX2MB(argv_[i]));
+ }