X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9dc44eff0235c5f30940f32ccc6d9d82a236e7d2..05e66a7002abbc726d3aa53fc5cb42ebaf8748e8:/src/gtk/listbox.cpp diff --git a/src/gtk/listbox.cpp b/src/gtk/listbox.cpp index 788f1f4cb2..6cdf71a549 100644 --- a/src/gtk/listbox.cpp +++ b/src/gtk/listbox.cpp @@ -36,7 +36,7 @@ #include "wx/gtk/treeentry_gtk.h" #include -#if GTK_CHECK_VERSION(3,0,0) +#ifdef __WXGTK3__ #include #endif @@ -404,7 +404,13 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id, wxListBox::~wxListBox() { - m_hasVMT = false; + if (m_treeview) + { + GTKDisconnect(m_treeview); + GtkTreeSelection* selection = gtk_tree_view_get_selection(m_treeview); + if (selection) + GTKDisconnect(selection); + } Clear(); } @@ -775,7 +781,7 @@ void wxListBox::DoScrollToCell(int n, float alignY, float alignX) wxCHECK_RET( IsValid(n), wxT("invalid index")); //RN: I have no idea why this line is needed... - if (gdk_pointer_is_grabbed () && gtk_widget_has_grab(GTK_WIDGET(m_treeview))) + if (gtk_widget_has_grab(GTK_WIDGET(m_treeview))) return; GtkTreeIter iter; @@ -925,7 +931,7 @@ wxSize wxListBox::DoGetBestSize() const wxVisualAttributes wxListBox::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant)) { - return GetDefaultAttributesFromGTKWidget(gtk_tree_view_new, true); + return GetDefaultAttributesFromGTKWidget(gtk_tree_view_new(), true); } #endif // wxUSE_LISTBOX