+ virtual void SetLabel(const wxString& title, wxFontEncoding encoding)
+ {
+ wxNSStaticTextView* v = (wxNSStaticTextView*)GetWXWidget();
+ wxWindow* wxpeer = GetWXPeer();
+ NSCell* cell = [v cell];
+ wxCFStringRef text( title , encoding );
+
+ NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
+ [paragraphStyle setLineBreakMode:m_lineBreak];
+ int style = wxpeer->GetWindowStyleFlag();
+ if (style & wxALIGN_CENTER)
+ [paragraphStyle setAlignment: NSCenterTextAlignment];
+ else if (style & wxALIGN_RIGHT)
+ [paragraphStyle setAlignment: NSRightTextAlignment];
+
+ NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:paragraphStyle, NSParagraphStyleAttributeName, nil];
+ NSAttributedString *attrstring = [[NSAttributedString alloc] initWithString:text.AsNSString() attributes:dict];
+ [cell setAttributedStringValue:attrstring];
+ [attrstring release];
+ [paragraphStyle release];
+ }
+private :
+ NSLineBreakMode m_lineBreak;
+};