X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/570aaadf1ff3f8c3f8ecfea44dbeae64532c82c4..cb73e6001f891ae46b12a1e4ca39b93649cb6099:/src/cocoa/statbox.mm diff --git a/src/cocoa/statbox.mm b/src/cocoa/statbox.mm index 766f6773fb..00a22bc123 100644 --- a/src/cocoa/statbox.mm +++ b/src/cocoa/statbox.mm @@ -12,6 +12,8 @@ #include "wx/app.h" #include "wx/statbox.h" +#include "wx/cocoa/autorelease.h" + #import #import @@ -27,13 +29,16 @@ bool wxStaticBox::Create(wxWindow *parent, wxWindowID winid, long style, const wxValidator& validator, const wxString& name) { + wxAutoNSAutoreleasePool pool; if(!CreateControl(parent,winid,pos,size,style,validator,name)) return false; m_cocoaNSView = NULL; - SetNSBox([[NSBox alloc] initWithFrame:NSMakeRect(0,0,30,30)]); + SetNSBox([[NSBox alloc] initWithFrame:MakeDefaultNSRect(size)]); [GetNSBox() setTitle:[NSString stringWithCString:title.c_str()]]; if(m_parent) m_parent->CocoaAddChild(this); + SetInitialFrameRect(pos,size); + return true; }