Closed Bug 331115 Opened 20 years ago Closed 7 years ago

Removing gtk_moz_embed from a container invalidates it

Categories

(Core Graveyard :: Embedding: GTK Widget, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: scott.ellington, Assigned: mpgritti)

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20051210 Epiphany/1.8.3 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20051210 Epiphany/1.8.3 Once a gtk_moz_embed widget has been added to a container and shown, removing it seems to place it in an invalid state. As when I add it right back to the same container, I get the following error: (Gecko:28867): Gtk-CRITICAL **: gtk_container_add: assertion `GTK_IS_WIDGET (widget)' failed If I try to do the same thing with a GtkButton, it can be removed and readded without such an error. I will attach sample code in one sec. Reproducible: Always
Attached file sample code
This is a programming error. The docs for gtk_container_remove are quite clear: Removes widget from container. widget must be inside container. Note that container will own a reference to widget, and that this may be the last reference held; so removing a widget from its container can destroy that widget. If you want to use widget again, you need to add a reference to it while it's not inside a container, using g_object_ref().
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
My mistake. I am not familiar with C Gtk. I am trying to reproduce a bug that occurs in Gtk#. However, with your tip, I was able to EXACTLY reproduce my problem. Adding the call g_object_ref ( mozembed ) before it is added to the container removes the assertion error, however you will notice that the content of the mozembed widget is blanked out when it is re-added. This should not happen. This is the problem I am seeing in Gtk#: http://bugzilla.ximian.com/show_bug.cgi?id=76715 I am reopening. Thank you very much for your patience.
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
(In reply to comment #3) > however you will notice that the content of the > mozembed widget is blanked out when it is re-added. This should not happen. > This is the problem I am seeing in Gtk#: > http://bugzilla.ximian.com/show_bug.cgi?id=76715 I think this is the same as this bug: http://bugzilla.gnome.org/show_bug.cgi?id=169116
QA Contact: pavlov → gtk-widget
Product: Core → Core Graveyard
Embedding: GTK Widget isn't a thing, closing.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago7 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: