X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/eccace042d8adfe2d45dae21ad924bfc4e0d9ed9..e9d7a889634ee5cbe90bcc639c6197a29169be3a:/src/gtk/listbox.cpp diff --git a/src/gtk/listbox.cpp b/src/gtk/listbox.cpp index 52e14405a1..788f1f4cb2 100644 --- a/src/gtk/listbox.cpp +++ b/src/gtk/listbox.cpp @@ -25,15 +25,15 @@ #include "wx/arrstr.h" #endif -#include "wx/gtk/private.h" -#include "wx/gtk/private/object.h" -#include "wx/gtk/treeentry_gtk.h" - #if wxUSE_TOOLTIPS #include "wx/tooltip.h" #endif #include +#include "wx/gtk/private.h" +#include "wx/gtk/private/gtk2-compat.h" +#include "wx/gtk/private/object.h" +#include "wx/gtk/treeentry_gtk.h" #include #if GTK_CHECK_VERSION(3,0,0) @@ -497,6 +497,8 @@ void wxListBox::DoClear() gtk_list_store_clear( m_liststore ); /* well, THAT was easy :) */ GTKEnableEvents(); + + UpdateOldSelections(); } void wxListBox::DoDeleteOneItem(unsigned int n) @@ -727,7 +729,7 @@ bool wxListBox::IsSelected( int n ) const GtkTreeIter iter; wxCHECK_MSG( GTKGetIteratorFor(n, &iter), false, wxT("Invalid index") ); - return gtk_tree_selection_iter_is_selected(selection, &iter); + return gtk_tree_selection_iter_is_selected(selection, &iter) != 0; } void wxListBox::DoSetSelection( int n, bool select ) @@ -814,7 +816,7 @@ int wxListBox::DoListHitTest(const wxPoint& point) const // need to translate from master window since it is in client coords gint binx, biny; gdk_window_get_geometry(gtk_tree_view_get_bin_window(m_treeview), - &binx, &biny, NULL, NULL, NULL); + &binx, &biny, NULL, NULL); GtkTreePath* path; if ( !gtk_tree_view_get_path_at_pos @@ -855,6 +857,9 @@ GdkWindow *wxListBox::GTKGetWindow(wxArrayGdkWindows& WXUNUSED(windows)) const void wxListBox::DoApplyWidgetStyle(GtkRcStyle *style) { +#ifdef __WXGTK3__ + // don't know if this is even necessary, or how to do it +#else if (m_hasBgCol && m_backgroundColour.IsOk()) { GdkWindow *window = gtk_tree_view_get_bin_window(m_treeview); @@ -865,8 +870,9 @@ void wxListBox::DoApplyWidgetStyle(GtkRcStyle *style) gdk_window_clear( window ); } } +#endif - gtk_widget_modify_style( GTK_WIDGET(m_treeview), style ); + GTKApplyStyle(GTK_WIDGET(m_treeview), style); } wxSize wxListBox::DoGetBestSize() const