+ DoSetAttrString(toAttr.GetNSAttributedString());
+ }
+#endif // wxUSE_MARKUP
+
+private:
+ void DoSetAttrString(NSMutableAttributedString *attrstring)
+ {
+ NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
+ [paragraphStyle setLineBreakMode:m_lineBreak];
+ int style = GetWXPeer()->GetWindowStyleFlag();
+ if (style & wxALIGN_CENTER)
+ [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];
+ }