#include "wx/app.h"
#include "wx/stattext.h"
+#include "wx/cocoa/autorelease.h"
+
#import <Foundation/NSString.h>
#import <AppKit/NSTextField.h>
+#include <math.h>
IMPLEMENT_DYNAMIC_CLASS(wxStaticText, wxControl)
BEGIN_EVENT_TABLE(wxStaticText, wxControl)
long style,
const wxString& name)
{
+ wxAutoNSAutoreleasePool pool;
if(!CreateControl(parent,winid,pos,size,style,wxDefaultValidator,name))
return false;
m_cocoaNSView = NULL;
[GetNSTextField() setBezeled: NO];
[GetNSTextField() setEditable: NO];
[GetNSTextField() setDrawsBackground: NO];
+
[GetNSControl() sizeToFit];
+ // Round-up to next integer size
+ NSRect nsrect = [m_cocoaNSView frame];
+ nsrect.size.width = ceil(nsrect.size.width);
+ [m_cocoaNSView setFrameSize: nsrect.size];
+
if(m_parent)
m_parent->CocoaAddChild(this);
return true;