X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/525007cf12a3025c2a6ca3c58663062e567c0e25..9d5507f7a2701395e1d5c121bd877bb9066ee6ea:/src/cocoa/button.mm?ds=sidebyside diff --git a/src/cocoa/button.mm b/src/cocoa/button.mm index 624e5271bd..4a14d6ba2d 100644 --- a/src/cocoa/button.mm +++ b/src/cocoa/button.mm @@ -49,6 +49,19 @@ bool wxButton::Create(wxWindow *parent, wxWindowID winid, [GetNSButton() setBezelStyle:NSRoundedBezelStyle]; CocoaSetLabelForObject(label, GetNSButton()); + + do + { + NSTextAlignment mode; + if ((style & wxBU_LEFT) && !(style & wxBU_RIGHT)) + mode = NSLeftTextAlignment; + else if ((style & wxBU_RIGHT) && !(style & wxBU_LEFT)) + mode = NSRightTextAlignment; + else + break; + [GetNSControl() setAlignment:mode]; + } while(0); + [GetNSControl() sizeToFit]; if(m_parent)