X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4b5f3fe655deeb91d5d3abe8fad30c4a1cae63dc..e29b83a455bead3dae44300f631d07aa9635d3e9:/src/motif/button.cpp?ds=sidebyside diff --git a/src/motif/button.cpp b/src/motif/button.cpp index c3f5be3ec4..814d1a2a51 100644 --- a/src/motif/button.cpp +++ b/src/motif/button.cpp @@ -40,6 +40,7 @@ bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label, m_windowStyle = style; m_backgroundColour = parent->GetBackgroundColour(); m_foregroundColour = parent->GetForegroundColour(); + m_windowFont = parent->GetFont(); parent->AddChild((wxButton *)this); @@ -53,6 +54,8 @@ bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label, XmString text = XmStringCreateSimple ((char*) (const char*) label1); Widget parentWidget = (Widget) parent->GetClientWidget(); + XmFontList fontList = (XmFontList) m_windowFont.GetFontList(1.0, XtDisplay(parentWidget)); + /* * Patch Note (important) * There is no major reason to put a defaultButtonThickness here. @@ -65,6 +68,7 @@ bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label, m_mainWidget = (WXWidget) XtVaCreateManagedWidget ("button", xmPushButtonWidgetClass, parentWidget, + XmNfontList, fontList, XmNlabelString, text, // XmNdefaultButtonShadowThickness, 1, // See comment for wxButton::SetDefault NULL); @@ -74,9 +78,6 @@ bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label, XtAddCallback ((Widget) m_mainWidget, XmNactivateCallback, (XtCallbackProc) wxButtonCallback, (XtPointer) this); - m_windowFont = parent->GetFont(); - ChangeFont(FALSE); - SetCanAddEventHandler(TRUE); AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y); @@ -97,7 +98,7 @@ void wxButton::SetDefault() // Because it's very hard to find wxButton in the same row, // correction is straighforward: we set resource for all wxButton // in this parent (but not sub panels) - for (wxNode * node = parent->GetChildren ()->First (); node; node = node->Next ()) + for (wxNode * node = parent->GetChildren().First (); node; node = node->Next ()) { wxButton *item = (wxButton *) node->Data (); if (item->IsKindOf(CLASSINFO(wxButton))) @@ -124,7 +125,7 @@ void wxButton::Command (wxCommandEvent & event) ProcessCommand (event); } -void wxButtonCallback (Widget w, XtPointer clientData, XtPointer ptr) +void wxButtonCallback (Widget w, XtPointer clientData, XtPointer WXUNUSED(ptr)) { if (!wxGetWindowFromTable(w)) // Widget has been deleted!