X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/33a5bc5299a068b4d6a313a7dc830a74edb5780a..7f985bd39a0605d8dea4b4b1abc717c5658209c6:/src/gtk/listbox.cpp diff --git a/src/gtk/listbox.cpp b/src/gtk/listbox.cpp index 2734acb622..2793afeb92 100644 --- a/src/gtk/listbox.cpp +++ b/src/gtk/listbox.cpp @@ -17,6 +17,16 @@ #include "wx/utils.h" #include +//------------------------------------------------------------------------- +// conditional compilation +//------------------------------------------------------------------------- + +#if (GTK_MINOR_VERSION == 1) +#if (GTK_MICRO_VERSION >= 5) +#define NEW_GTK_SCROLL_CODE +#endif +#endif + //----------------------------------------------------------------------------- // data //----------------------------------------------------------------------------- @@ -91,7 +101,12 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id, gtk_list_set_selection_mode( GTK_LIST(m_list), mode ); +#ifdef NEW_GTK_SCROLL_CODE + gtk_scrolled_window_add_with_viewport( GTK_SCROLLED_WINDOW(m_widget), GTK_WIDGET(m_list) ); +#else gtk_container_add( GTK_CONTAINER(m_widget), GTK_WIDGET(m_list) ); +#endif + gtk_widget_show( GTK_WIDGET(m_list) ); wxSize newSize = size; @@ -163,7 +178,9 @@ void wxListBox::AppendCommon( const wxString &item ) ConnectWidget( list_item ); +#ifndef NEW_GTK_DND_CODE if (m_dropTarget) m_dropTarget->RegisterWidget( list_item ); +#endif } void wxListBox::Append( const wxString &item ) @@ -481,6 +498,7 @@ void wxListBox::SetDropTarget( wxDropTarget *dropTarget ) { wxCHECK_RET( m_list != NULL, "invalid listbox" ); +#ifndef NEW_GTK_DND_CODE if (m_dropTarget) { GList *child = m_list->children; @@ -490,9 +508,11 @@ void wxListBox::SetDropTarget( wxDropTarget *dropTarget ) child = child->next; } } +#endif + + wxWindow::SetDropTarget( dropTarget ); - wxWindow::SetDropTarget( dropTarget ); - +#ifndef NEW_GTK_DND_CODE if (m_dropTarget) { GList *child = m_list->children; @@ -502,6 +522,7 @@ void wxListBox::SetDropTarget( wxDropTarget *dropTarget ) child = child->next; } } +#endif } GtkWidget *wxListBox::GetConnectWidget()