[gtk: 1/2] invalid cast from 'GtkButton' to 'GtkBox'




commit 9c79b8b8778ce2600dc7f1c492a0da93e314e1b6
Author: Caolán McNamara <caolanm redhat com>
Date:   Tue Jun 1 14:41:13 2021 +0100

    invalid cast from 'GtkButton' to 'GtkBox'
    
    on adding a page to a GtkNotebook
    
    (soffice): Gtk-CRITICAL **: gtk_box_remove: assertion 'GTK_IS_BOX (box)' failed

 gtk/gtknotebook.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index cf2a7a9310..57b87f5f2e 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -5652,8 +5652,8 @@ gtk_notebook_menu_item_recreate (GtkNotebook *notebook,
   GtkNotebookPage *page = list->data;
   GtkWidget *menu_item = gtk_widget_get_parent (page->menu_label);
 
-  gtk_box_remove (GTK_BOX (menu_item), page->menu_label);
-  gtk_widget_unparent (menu_item);
+  gtk_button_set_child (GTK_BUTTON (menu_item), NULL);
+  gtk_box_remove (GTK_BOX (notebook->menu_box), menu_item);
   gtk_notebook_menu_item_create (notebook, page);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]