From cefcd83ee66a69d301c8b662a557d6357d6f3ebe Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Sun, 17 Dec 2017 21:52:00 -0800 Subject: [PATCH] Avoid GtkHandleBox and GtkEventBox with GTK+4 --- src/gtk/toolbar.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gtk/toolbar.cpp b/src/gtk/toolbar.cpp index 94ab7a3c08..f432879948 100644 --- a/src/gtk/toolbar.cpp +++ b/src/gtk/toolbar.cpp @@ -423,6 +423,10 @@ bool wxToolBar::Create( wxWindow *parent, #endif GtkSetStyle(); +#ifdef __WXGTK4__ + m_widget = m_toolbar; +#else + wxGCC_WARNING_SUPPRESS(deprecated-declarations) if ((style & wxTB_DOCKABLE) #ifdef __WXGTK3__ // using GtkHandleBox prevents toolbar from drawing with GTK+ >= 3.19.7 @@ -445,8 +449,10 @@ bool wxToolBar::Create( wxWindow *parent, m_widget = gtk_event_box_new(); ConnectWidget( m_widget ); } - g_object_ref(m_widget); gtk_container_add(GTK_CONTAINER(m_widget), GTK_WIDGET(m_toolbar)); + wxGCC_WARNING_RESTORE() +#endif // !__WXGTK4__ + g_object_ref(m_widget); gtk_widget_show(GTK_WIDGET(m_toolbar)); m_parent->DoAddChild( this );