]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/textctrl.mm
New default configuration is debug/static
[wxWidgets.git] / src / cocoa / textctrl.mm
index c04e12a99e415cb21f33fb02994e47ca7052f751..78c930b41e25eaea146ca39f03e66848fa5462fd 100644 (file)
@@ -36,12 +36,19 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID winid,
     if(!CreateControl(parent,winid,pos,size,style,validator,name))
         return false;
     m_cocoaNSView = NULL;
     if(!CreateControl(parent,winid,pos,size,style,validator,name))
         return false;
     m_cocoaNSView = NULL;
-    SetNSTextField([[NSTextField alloc] initWithFrame:NSMakeRect(0,0,30,30)]);
+    SetNSTextField([[NSTextField alloc] initWithFrame:MakeDefaultNSRect(size)]);
     [m_cocoaNSView release];
     [GetNSTextField() setStringValue:[NSString stringWithCString:value.c_str()]];
     [GetNSControl() sizeToFit];
     [m_cocoaNSView release];
     [GetNSTextField() setStringValue:[NSString stringWithCString:value.c_str()]];
     [GetNSControl() sizeToFit];
+    NSRect currentFrame = [m_cocoaNSView frame];
+    if(currentFrame.size.width < 70)
+    {
+        currentFrame.size.width = 70;
+        [m_cocoaNSView setFrame:currentFrame];
+    }
     if(m_parent)
         m_parent->CocoaAddChild(this);
     if(m_parent)
         m_parent->CocoaAddChild(this);
+    SetInitialFrameRect(pos,size);
     return true;
 }
 
     return true;
 }