]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/textctrl.cpp
bmps and ico added as binaries
[wxWidgets.git] / src / gtk / textctrl.cpp
index a81a25db284d52b76c5c654ce0290dd2e5f996e8..e832dcdf05704efc246545ba426a6e515d07878c 100644 (file)
@@ -192,7 +192,15 @@ bool wxTextCtrl::Create( wxWindow *parent,
           m_text = gtk_entry_new();
     }
 
-    SetSizeOrDefault( size );
+    wxSize new_size = size,
+           sizeBest = DoGetBestSize();
+    if (new_size.x == -1)
+        new_size.x = sizeBest.x;
+    if (new_size.y == -1)
+        new_size.y = sizeBest.y;
+
+    if ((new_size.x != size.x) || (new_size.y != size.y))
+        SetSize( new_size.x, new_size.y );
 
     m_parent->DoAddChild( this );
 
@@ -977,5 +985,6 @@ void wxTextCtrl::OnInternalIdle()
 wxSize wxTextCtrl::DoGetBestSize() const
 {
     // FIXME should be different for multi-line controls...
-    return wxSize(80, 26);
+    wxSize ret( wxControl::DoGetBestSize() );
+    return wxSize(80, ret.y);
 }