X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b0ee47ff76c278c053ac2ad36bb3129b0fcd050f..cfcc39321282c5877cbb45248bb8004ced24516b:/src/motif/button.cpp diff --git a/src/motif/button.cpp b/src/motif/button.cpp index 5aacdf44ae..de02890cb2 100644 --- a/src/motif/button.cpp +++ b/src/motif/button.cpp @@ -111,7 +111,7 @@ void wxButton::SetDefault() { wxWindow *parent = GetParent(); if ( parent ) - panel->SetDefaultItem(this); + parent->SetDefaultItem(this); // We initially do not set XmNdefaultShadowThickness, to have small buttons. // Unfortunately, buttons are now mis-aligned. We try to correct this @@ -119,10 +119,12 @@ 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 (wxWindowList::Node * node = parent->GetChildren().GetFirst (); + node; node = node->GetNext ()) { - wxButton *item = (wxButton *) node->Data (); - if (item->IsKindOf(CLASSINFO(wxButton))) + wxWindow *win = node->GetData (); + wxButton *item = wxDynamicCast(win, wxButton); + if (item) { bool managed = XtIsManaged((Widget) item->GetMainWidget()); if (managed)