]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/utils.cpp
added more utils subprojects
[wxWidgets.git] / src / motif / utils.cpp
index ef1bbe2a6234404acd9bc0cd100d03547df87423..b8d38a52823918896cbe94cb13473c44bb930c3a 100644 (file)
@@ -126,7 +126,7 @@ int wxGetOsVersion(int *majorVsn, int *minorVsn)
 }
 
 // Reading and writing resources (eg WIN.INI, .Xdefaults)
-#if USE_RESOURCES
+#if wxUSE_RESOURCES
 bool wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file)
 {
     // TODO
@@ -198,7 +198,7 @@ bool wxGetResource(const wxString& section, const wxString& entry, int *value, c
   }
   else return FALSE;
 }
-#endif // USE_RESOURCES
+#endif // wxUSE_RESOURCES
 
 static int wxBusyCursorCount = 0;
 
@@ -290,7 +290,12 @@ WXDisplay *wxGetDisplay()
   if (gs_currentDisplay)
     return gs_currentDisplay;
 
-  return XtDisplay ((Widget) wxTheApp->GetTopLevelWidget());
+  if (wxTheApp && wxTheApp->GetTopLevelWidget())
+    return XtDisplay ((Widget) wxTheApp->GetTopLevelWidget());
+  else if (wxTheApp)
+    return wxTheApp->GetInitialDisplay();
+  else
+    return (WXDisplay*) NULL;
 }
 
 bool wxSetDisplay(const wxString& display_name)