+ insensPixmap = (Pixmap) m_bitmaps[State_Disabled].GetDrawable();
+ }
+ else
+ insensPixmap = (Pixmap) m_bitmapCache.GetInsensPixmap(m_mainWidget);
+ }
+ else
+ insensPixmap = (Pixmap) m_bitmapCache.GetInsensPixmap(m_mainWidget);
+
+ // Now make the bitmap representing the armed state
+ if (m_bitmapsOriginal[State_Pressed].IsOk())
+ {
+ if (m_bitmapsOriginal[State_Pressed].GetMask())
+ {
+ WXPixel backgroundPixel;
+ XtVaGetValues((Widget) m_mainWidget,
+ XmNarmColor, &backgroundPixel,
+ NULL);
+
+ wxColour col;
+ col.SetPixel(backgroundPixel);
+
+ wxBitmap newBitmap =
+ wxCreateMaskedBitmap(m_bitmapsOriginal[State_Pressed], col);
+ m_bitmaps[State_Pressed] = newBitmap;
+
+ armPixmap = (Pixmap) m_bitmaps[State_Pressed].GetDrawable();
+ }
+ else
+ armPixmap = (Pixmap) m_bitmapCache.GetArmPixmap(m_mainWidget);
+ }
+ else
+ armPixmap = (Pixmap) m_bitmapCache.GetArmPixmap(m_mainWidget);
+
+ XtVaSetValues ((Widget) m_mainWidget,
+ XmNlabelPixmap, pixmap,
+ XmNlabelInsensitivePixmap, insensPixmap,
+ XmNarmPixmap, armPixmap,
+ XmNlabelType, XmPIXMAP,
+ NULL);
+ }
+ else
+ {
+ // Null bitmap: must not use current pixmap
+ // since it is no longer valid.
+ XtVaSetValues ((Widget) m_mainWidget,
+ XmNlabelType, XmSTRING,
+ XmNlabelPixmap, XmUNSPECIFIED_PIXMAP,
+ XmNlabelInsensitivePixmap, XmUNSPECIFIED_PIXMAP,
+ XmNarmPixmap, XmUNSPECIFIED_PIXMAP,
+ NULL);
+ }