diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index a5494c269b..4e4cf7a5b5 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -817,7 +817,14 @@ bool wxTextCtrl::Create( wxWindow *parent, if (!value.empty()) { ChangeValue(value); - InvalidateBestSize(); + + // The call to SetInitialSize() from inside PostCreation() didn't take + // the value into account because it hadn't been set yet when it was + // called (and setting it earlier wouldn't have been correct neither, + // as the appropriate size depends on the presence of the borders, + // which are configured in PostCreation()), so recompute the initial + // size again now that we have set it. + SetInitialSize(size); } if (style & wxTE_PASSWORD)