From 27d218a1f36316e05453234febb74177fee39a8f Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Mon, 14 Nov 2016 10:38:46 -0800 Subject: [PATCH] Set a minimal size for GtkEntry preferred size This overrides the default minimum size of 150+ pixels, avoiding swarms of GTK3 debug warnings about "attempt to underallocate wxPizza's child GtkEntry" --- src/gtk/textctrl.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index 772bb94c20..1fa5d5829a 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -718,6 +718,11 @@ bool wxTextCtrl::Create( wxWindow *parent, // a single-line text control: no need for scrollbars m_widget = m_text = gtk_entry_new(); + + // Set a minimal width for preferred size to avoid GTK3 debug warnings + // about size allocations smaller than preferred size + gtk_entry_set_width_chars((GtkEntry*)m_text, 1); + // work around probable bug in GTK+ 2.18 when calling WriteText on a // new, empty control, see http://trac.wxwidgets.org/ticket/11409 gtk_entry_get_text((GtkEntry*)m_text);