From: Julian Smart Date: Sat, 11 Mar 2006 13:24:07 +0000 (+0000) Subject: Applied patch [ 1447666 ] Fix obscure GTK wxListBox construction bug X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/b6e5dfeff3d52e435f7f57143299829cfcc0d18a Applied patch [ 1447666 ] Fix obscure GTK wxListBox construction bug git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37992 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/gtk/listbox.h b/include/wx/gtk/listbox.h index 7804a96625..544d10dd0c 100644 --- a/include/wx/gtk/listbox.h +++ b/include/wx/gtk/listbox.h @@ -18,7 +18,10 @@ class WXDLLIMPEXP_CORE wxListBox : public wxListBoxBase { public: // ctors and such - wxListBox(); + wxListBox() + { + Init(); + } wxListBox( wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, @@ -27,9 +30,7 @@ public: const wxValidator& validator = wxDefaultValidator, const wxString& name = wxListBoxNameStr ) { -#if wxUSE_CHECKLISTBOX - m_hasCheckBoxes = FALSE; -#endif // wxUSE_CHECKLISTBOX + Init(); Create(parent, id, pos, size, n, choices, style, validator, name); } wxListBox( wxWindow *parent, wxWindowID id, @@ -40,13 +41,13 @@ public: const wxValidator& validator = wxDefaultValidator, const wxString& name = wxListBoxNameStr ) { -#if wxUSE_CHECKLISTBOX - m_hasCheckBoxes = FALSE; -#endif // wxUSE_CHECKLISTBOX + Init(); Create(parent, id, pos, size, choices, style, validator, name); } virtual ~wxListBox(); + void Init(); //common construction + bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, diff --git a/src/gtk/listbox.cpp b/src/gtk/listbox.cpp index d908514a19..2028db5fea 100644 --- a/src/gtk/listbox.cpp +++ b/src/gtk/listbox.cpp @@ -419,7 +419,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl) // construction // ---------------------------------------------------------------------------- -wxListBox::wxListBox() +void wxListBox::Init() { m_treeview = (GtkTreeView*) NULL; #if wxUSE_CHECKLISTBOX