panel applet Warnings



I'm trying to swap images when a button is pressed. When I click it the first time it switches correctly but when I click the button again it should switch back to the original image but doesn't.

While clicking on the buttons, I get the following..

(my-applet:7414): Gtk-CRITICAL **: file gtkcontainer.c: line 992 (gtk_container_remove): assertion `GTK_IS_TOOLBAR (container) || widget->parent == GTK_WIDGET (container)' failed

(my-applet:7348): Gtk-WARNING **: Attempting to add a widget with type GtkImage to a container of type GtkEventBox, but the widget is already inside a container of type GtkEventBox, the GTK+ FAQ at http://www.gtk.org/faq/ explains how to reparent a widget.

I looked at the faq and followed the ref and unref functions but it still gives me these errors..

any help? thanks.. craig.

--------------------------------

code snippet is as follows:

// play_button, pause_button, and play_event_box are type GtkWidget*

gtk_widget_ref(play_button);
gtk_container_remove (GTK_CONTAINER (play_event_box), play_button);
gtk_container_add (GTK_CONTAINER (play_event_box), pause_button);
gtk_widget_unref(play_button);
gtk_widget_show_all(play_event_box);



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