]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/textctrl.cpp
Align initial size handling with other ports.
[wxWidgets.git] / src / motif / textctrl.cpp
index 06e42ff6c7272a8a9020a86febdcc4f3049ae640..52867950ee2d18b4402eb05c843597c6ecfccef4 100644 (file)
@@ -196,12 +196,8 @@ bool wxTextCtrl::Create(wxWindow *parent,
     // font
     ChangeFont(false);
 
-    wxSize best = GetBestSize();
-    if( size.x != -1 ) best.x = size.x;
-    if( size.y != -1 ) best.y = size.y;
-
     AttachWidget (parent, m_mainWidget, (WXWidget) NULL,
-                  pos.x, pos.y, best.x, best.y);
+                  pos.x, pos.y, size.x, size.y);
 
     ChangeBackgroundColour();
 
@@ -683,7 +679,13 @@ wxSize wxDoGetSingleTextCtrlBestSize( Widget textWidget,
 wxSize wxTextCtrl::DoGetBestSize() const
 {
     if( IsSingleLine() )
-        return wxDoGetSingleTextCtrlBestSize( (Widget)m_mainWidget, this );
+    {
+        wxSize best = wxControl::DoGetBestSize();
+
+        if( best.x < 110 ) best.x = 110;
+
+        return best;
+    }
     else
         return wxWindow::DoGetBestSize();
 }