![]() |
Strange behaviour from gtk_widget_destroy
I'm writing a fairly simple countdown timer app, and am destroying a vbox with a couple of hboxes with buttons and labels in.
It's early days yet so I've just been running it in scratchbox x86. If I click on my delete button, it calls gtk_widget_destroy on the box fine, and disappears as I'd expect it to. On the console there are no errors. However, if I then move the mouse pointer over the title bar or the close icon, or the notification area, I get this message instantly on the console: Code:
bbtimer[8559]: GLIB CRITICAL ** GLib-GObject - g_object_ref: assertion `G_IS_OBJECT (object)' failed Any ideas? I'm still pretty new at this GTK thing but getting a bit better at it (I think...) |
Re: Strange behaviour from gtk_widget_destroy
Is the button within that vbox?
Hard to say... Why call gtk_widget_destroy manually at all? What are you trying to do? |
Re: Strange behaviour from gtk_widget_destroy
I want the application to have multiple, independent timers. The vbox holds the gui elements for one of these timers, including several buttons (Start/Stop, Reset and Delete). It'd be good to be able to remove timers when you don't want them any more so I added the delete button which runs the gtk_widget_destroy when clicked.
|
Re: Strange behaviour from gtk_widget_destroy
I don't know, maybe you messed up something with the refcounting or it is a bug in the maemo version of gtk? Code? :-)
I tried the worst possible scenario and that works: #include <gtk/gtk.h> static void delete_box(GtkButton* button_1, GtkBox* box) { gtk_widget_destroy(box); } int main(int argc, char* argv[]) { GtkWindow* window; GtkVBox* box_1; GtkButton* button_1; gtk_init(&argc, &argv); window = gtk_window_new(GTK_WINDOW_TOPLEVEL); box_1 = gtk_vbox_new(TRUE, 1); button_1 = gtk_button_new_with_label("Foo"); g_signal_connect(button_1, "clicked", delete_box, box_1); gtk_box_pack_start(box_1, button_1, FALSE, FALSE, 0); gtk_container_add(window, box_1); gtk_widget_show_all(window); gtk_main(); return 0; } |
Re: Strange behaviour from gtk_widget_destroy
Quote:
|
All times are GMT. The time now is 23:13. |
vBulletin® Version 3.8.8