]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/utils.cpp
don't erase the background to see the transparent images better
[wxWidgets.git] / src / motif / utils.cpp
index 179a3a43d630eed436a7752b6f847014070af82c..78989f932c35c0b4d426f13a1fb3f663451018ec 100644 (file)
@@ -81,7 +81,9 @@
     #define DEFAULT_XRESOURCE_DIR "/usr/lib/X11/app-defaults"
 #endif
 
+#if wxUSE_RESOURCES
 static char *GetIniFile (char *dest, const char *filename);
+#endif
 
 // ============================================================================
 // implementation
@@ -226,6 +228,8 @@ int wxGetOsVersion(int *majorVsn, int *minorVsn)
 // Reading and writing resources (eg WIN.INI, .Xdefaults)
 // ----------------------------------------------------------------------------
 
+#if wxUSE_RESOURCES
+
 // Read $HOME for what it says is home, if not
 // read $USER or $LOGNAME for user name else determine
 // the Real User, then determine the Real home dir.
@@ -256,8 +260,6 @@ static char * GetIniFile (char *dest, const char *filename)
     return dest;
 }
 
-#if wxUSE_RESOURCES
-
 static char *GetResourcePath(char *buf, const char *name, bool create = FALSE)
 {
     if (create && wxFileExists (name) ) {
@@ -1245,6 +1247,21 @@ void wxDoChangeBackgroundColour(WXWidget widget, wxColour& backgroundColour, boo
         NULL);
 }
 
+extern void wxDoChangeFont(WXWidget widget, wxFont& font)
+{
+    // lesstif 0.87 hangs here, but 0.93 does not
+#if !defined(LESSTIF_VERSION) \
+    || (defined(LesstifVersion) && LesstifVersion >= 93)
+
+    Widget w = (Widget)widget;
+    XmFontList fontList = (XmFontList)font.GetFontList(1.0, XtDisplay(w));
+    XtVaSetValues( w,
+                   XmNfontList, fontList,
+                   NULL );
+#endif
+
+}
+
 #endif
     // __WXMOTIF__
 
@@ -1255,3 +1272,17 @@ bool wxWindowIsVisible(Window win)
 
     return (wa.map_state == IsViewable);
 }
+
+wxString wxXmStringToString( const XmString& xmString )
+{
+    char *txt;
+    if( XmStringGetLtoR( xmString, XmSTRING_DEFAULT_CHARSET, &txt ) )
+    {
+        wxString str(txt);
+        XtFree (txt);
+        return str;
+    }
+
+    return wxEmptyString;
+}
+