+class wxStaticTextCocoaImpl : public wxWidgetCocoaImpl
+{
+public:
+ wxStaticTextCocoaImpl( wxWindowMac* peer , WXWidget w ) : wxWidgetCocoaImpl(peer, w)
+ {
+ }
+
+ virtual void SetLabel(const wxString& title, wxFontEncoding encoding)
+ {
+ wxNSStaticTextView* v = (wxNSStaticTextView*)GetWXWidget();
+ wxWindow* wxpeer = GetWXPeer();
+ [v setString: wxCFStringRef( title , wxpeer->GetFont().GetEncoding() ).AsNSString()];
+
+ int style = wxpeer->GetWindowStyleFlag();
+ NSRange allText = NSMakeRange(0, title.length());
+ if (style & wxALIGN_CENTER)
+ [v setAlignment: NSCenterTextAlignment range: allText];
+ else if (style & wxALIGN_RIGHT)
+ [v setAlignment: NSRightTextAlignment range: allText];
+ }
+};