X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/989d151ce264820d43f01b5378aa8efc2c774d33..385e8575dd1f9219fb0e3f7fa26ffe4c24d2fdbb:/src/gtk/notebook.cpp diff --git a/src/gtk/notebook.cpp b/src/gtk/notebook.cpp index 1185f59526..3b61cd153e 100644 --- a/src/gtk/notebook.cpp +++ b/src/gtk/notebook.cpp @@ -434,7 +434,7 @@ bool wxNotebook::InsertPage( size_t position, if ( style ) { gtk_widget_modify_style(pageData->m_label, style); - gtk_rc_style_unref(style); + g_object_unref(style); } if (select && GetPageCount() > 1) @@ -453,24 +453,30 @@ static bool IsPointInsideWidget(const wxPoint& pt, GtkWidget *w, gint x, gint y, gint border = 0) { + GtkAllocation a; + gtk_widget_get_allocation(w, &a); return - (pt.x >= w->allocation.x - x - border) && - (pt.x <= w->allocation.x - x + border + w->allocation.width) && - (pt.y >= w->allocation.y - y - border) && - (pt.y <= w->allocation.y - y + border + w->allocation.height); + (pt.x >= a.x - x - border) && + (pt.x <= a.x - x + border + a.width) && + (pt.y >= a.y - y - border) && + (pt.y <= a.y - y + border + a.height); } int wxNotebook::HitTest(const wxPoint& pt, long *flags) const { - const gint x = m_widget->allocation.x; - const gint y = m_widget->allocation.y; + GtkAllocation a; + gtk_widget_get_allocation(m_widget, &a); + const int x = a.x; + const int y = a.y; const size_t count = GetPageCount(); size_t i = 0; +#if !GTK_CHECK_VERSION(3,0,0) && !defined(GSEAL_ENABLE) GtkNotebook * notebook = GTK_NOTEBOOK(m_widget); if (gtk_notebook_get_scrollable(notebook)) i = g_list_position( notebook->children, notebook->first_tab ); +#endif for ( ; i < count; i++ ) { @@ -556,7 +562,7 @@ void wxNotebook::DoApplyWidgetStyle(GtkRcStyle *style) GdkWindow *wxNotebook::GTKGetWindow(wxArrayGdkWindows& windows) const { - windows.push_back(m_widget->window); + windows.push_back(gtk_widget_get_window(m_widget)); windows.push_back(GTK_NOTEBOOK(m_widget)->event_window); return NULL;