From: Robert Roebling Date: Thu, 2 Mar 2006 09:55:07 +0000 (+0000) Subject: Use GTK+ function to obtain GdkWindow for wxListBox. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/04e044c4d6dab8b3164479f9b2d36d5b6a7c8610 Use GTK+ function to obtain GdkWindow for wxListBox. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37773 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/gtk/listbox.h b/include/wx/gtk/listbox.h index 3776c3d190..0acc30272e 100644 --- a/include/wx/gtk/listbox.h +++ b/include/wx/gtk/listbox.h @@ -82,7 +82,6 @@ public: GtkWidget *GetConnectWidget(); bool IsOwnGtkWindow( GdkWindow *window ); - GdkWindow* GetGtkBinWindow(); void OnInternalIdle(); #if wxUSE_TOOLTIPS diff --git a/src/gtk/listbox.cpp b/src/gtk/listbox.cpp index 85a5d1a187..b49029ab73 100644 --- a/src/gtk/listbox.cpp +++ b/src/gtk/listbox.cpp @@ -1045,35 +1045,14 @@ GtkWidget *wxListBox::GetConnectWidget() bool wxListBox::IsOwnGtkWindow( GdkWindow *window ) { - return (window == GetGtkBinWindow()); -} - -GdkWindow* wxListBox::GetGtkBinWindow() -{ - // GtkTreeView has 2 GdkWindows (just like GtkPizza and - // any other GtkWidget that can scroll). The one on top - // is usually called "->bin_window" and is the one we are - // looking for here. Since GtkTreeView hides this in the - // private data section, we assume that "->window" only has - // one child window, namely, the "->bin_window". - - GdkWindow *window = GTK_WIDGET(m_treeview)->window; - if (window == NULL) - return NULL; - - GList *children = gdk_window_peek_children( window ); - if (g_list_length(children) == 0) - return NULL; - - GdkWindow *bin_window = (GdkWindow*) g_list_nth_data( children, 0 ); - return bin_window; + return (window == gtk_tree_view_get_bin_window(m_treeview)); } void wxListBox::DoApplyWidgetStyle(GtkRcStyle *style) { if (m_hasBgCol && m_backgroundColour.Ok()) { - GdkWindow *window = GetGtkBinWindow(); + GdkWindow *window = gtk_tree_view_get_bin_window(m_treeview); if (window) { m_backgroundColour.CalcPixel( gdk_window_get_colormap( window ) ); @@ -1097,7 +1076,7 @@ void wxListBox::OnInternalIdle() as setting the cursor in a parent window also effects the windows above so that checking for the current cursor is not possible. */ - GdkWindow *window = GetGtkBinWindow(); + GdkWindow *window = gtk_tree_view_get_bin_window(m_treeview); gdk_window_set_cursor( window, cursor.GetCursor() ); }