Re: [gtk-list] warning/crash removing widgets from box




On Mon, 31 Aug 1998, Stephen Tell wrote:
> Whatever I try, when running on HP-UX, I get a lot of runtime warnings
> messages of this form but the button does disappear:
> ** WARNING **: invalid cast from `GtkButton' to `GtkToggleButton'
> ** WARNING **: invalid cast from `(unknown)' to `GtkToggleButton'
> ** WARNING **: invalid cast from `(unknown)' to `GtkToggleButton'
> ** WARNING **: invalid cast from `(unknown)' to `GtkToggleButton'
> ** WARNING **: invalid cast from `(unknown)' to `GtkToggleButton'
> ** WARNING **: invalid cast from `(unknown)' to `GtkToggleButton'
> 
> 
> On Linux I usually get a SIGSEGV, after one or two runtime warnings:
> ** WARNING **: invalid cast from `GtkButton' to `GtkToggleButton'
> ** WARNING **: file gtkcontainer.c: line 359 (gtk_container_remove):
> "widget->parent == GTK_WIDGET (container)"
> ** ERROR **: sigsegv caught
> 

These warnings could be a Gtk bug, but more likely it's a bug in your
program. The invalid cast warnings are usually memory corruption (there's
garbage in the GtkObject type field).

Keep in mind that removing from a container will decrement the reference
count and automatically destroy the widget unless you _ref it before you
remove.

Havoc





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