-
- m_font = parent->GetFont();
- ChangeFont(FALSE);
-
- ChangeBackgroundColour ();
-
- DoSetBitmap();
-
- XtAddCallback (buttonWidget, XmNactivateCallback, (XtCallbackProc) wxButtonCallback,
- (XtPointer) this);
-
- SetCanAddEventHandler(TRUE);
- AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y);
-
- return TRUE;
+
+ XtAddCallback (buttonWidget,
+ XmNactivateCallback, (XtCallbackProc) wxButtonCallback,
+ (XtPointer) this);
+
+ wxSize best = GetBitmapLabel().IsOk() ? GetBestSize() : wxSize(30, 30);
+ if( size.x != -1 ) best.x = size.x;
+ if( size.y != -1 ) best.y = size.y;
+
+ PostCreation();
+ OnSetBitmap();
+
+ AttachWidget (parent, m_mainWidget, (WXWidget) NULL,
+ pos.x, pos.y, best.x, best.y);
+
+ return true;