- wxClientDC dc(const_cast<wxStaticText*>(this));
- wxCoord width, height ;
- dc.GetMultiLineTextExtent( m_label , &width, &height);
- // FIXME: The calculations returned by this function are too small
- // for some strings, so we adjust manually.
- bounds.h = width+12;
- bounds.v = height+4;
+ NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
+ [paragraphStyle setLineBreakMode:m_lineBreak];
+ int style = GetWXPeer()->GetWindowStyleFlag();
+ if (style & wxALIGN_CENTER_HORIZONTAL)
+ [paragraphStyle setAlignment: NSCenterTextAlignment];
+ else if (style & wxALIGN_RIGHT)
+ [paragraphStyle setAlignment: NSRightTextAlignment];
+
+ [attrstring addAttribute:NSParagraphStyleAttributeName
+ value:paragraphStyle
+ range:NSMakeRange(0, [attrstring length])];
+ NSCell* cell = [(wxNSStaticTextView *)GetWXWidget() cell];
+ [cell setAttributedStringValue:attrstring];
+ [paragraphStyle release];