Reply
Thread Tools
Posts: 7 | Thanked: 0 times | Joined on Mar 2010 @ Sheffield UK
#1
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
bbtimer[8559]: GLIB CRITICAL ** GLib-GObject - g_object_ref: assertion `G_IS_OBJECT (object)' failed
Everything else seems to be fine afterwards. If I just run gtk_widget_hide instead it doesn't produce this error.

Any ideas? I'm still pretty new at this GTK thing but getting a bit better at it (I think...)
 
Posts: 56 | Thanked: 31 times | Joined on Jul 2008 @ Austria
#2
Is the button within that vbox?
Hard to say...
Why call gtk_widget_destroy manually at all? What are you trying to do?
 
Posts: 7 | Thanked: 0 times | Joined on Mar 2010 @ Sheffield UK
#3
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.
 
Posts: 56 | Thanked: 31 times | Joined on Jul 2008 @ Austria
#4
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;
}

Last edited by dannym; 2010-09-13 at 10:16.
 
Venemo's Avatar
Posts: 1,296 | Thanked: 1,773 times | Joined on Aug 2009 @ Budapest, Hungary
#5
Originally Posted by benbrown View Post
...
We need to see your code before we can help.
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 23:32.