X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/525007cf12a3025c2a6ca3c58663062e567c0e25..6fbc26369080e00d2ef9dcab84adb82f12ec2c90:/src/cocoa/button.mm 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)