+
+ [(NSTextField*)m_cocoaNSView setTarget: sm_cocoaTarget];
+ [(NSTextField*)m_cocoaNSView setAction:@selector(wxNSControlAction:)];
+
+ // set the text alignment option
+ NSTextAlignment alignStyle;
+ if (style & wxTE_RIGHT)
+ alignStyle = NSRightTextAlignment;
+ else if (style & wxTE_CENTRE)
+ alignStyle = NSCenterTextAlignment;
+ else // default to wxTE_LEFT because it is 0 and can't be tested
+ alignStyle = NSLeftTextAlignment;
+ [GetNSControl() setAlignment:alignStyle];
+
+ // if Read-only then set as such, this flag is overwritable by wxTextCtrl::SetEditable(TRUE)
+ if (style & wxTE_READONLY)
+ {
+ SetEditable(FALSE);
+ }
+