Delete all children from a GtkBox in Gtk4

I’m deleting the kids from a GtkBox, it works, but I’m getting a warning and a blink.

Gtk-WARNING **: 14:49:38.470: Trying to snapshot GtkPaned 000002d6a2e99570 without a current allocation

Code:

GtkWidget *childs = gtk_widget_get_first_child(box_parent);
while (childs != NULL)
{
    gtk_box_remove(GTK_BOX(box_parent), childs);
    childs = gtk_widget_get_first_child(box_parent);
}

ezgif.com-gif-maker

Are you perchance removing the children during a size_allocate() or a snapshot() implementation?

I’m just adding and removing children from “GtkBox.”

What does have to do with removing children?

I’m asking if you’re removing children, adding them, or changing their visibility during a size_allocate() or a snapshot() implementation.

I am not using size_allocate or snapshot, I was doing some tests the problem only happens when you click on the GLArea.

But check that it is not the delete the children of the GtkBox.

ezgif.com-gif-maker

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.