Re: [gtkmm] Deleting child widgets in a Gtk::Table



Murray Cumming <murrayc murrayc com> writes:

> On Wed, 2004-04-28 at 18:47, Roger Leigh wrote:
>> (epicpos:10851): Gtk-CRITICAL **: file gtkcontainer.c: line 983
>> (gtk_container_remove): assertion `GTK_IS_WIDGET (widget)' failed
>> 2,3,0,1 = overlap
>> Deleting widget at 2,0
>>   
>> (epicpos:10851): Gtk-CRITICAL **: file gtkcontainer.c: line 983
>> (gtk_container_remove): assertion `GTK_IS_WIDGET (widget)' failed
>> 
>> The widget with top-left corner (2,1) was skipped.  Am I using the
>> TableList::erase method incorrectly?  Are the iterators invalidated by
>> an erase()?
>
> With gtkmm 2.0/2.2, if the child widget is manage()ed, you'll need to do
> a reference() on the child widget before calling remove(), to keep it
> alive. Hopefully that's helpful. This is fixed in gtkmm 2.4.

This works.  I did

  widget->reference();
  remove(*widget);
  widget->unreference();

and all works fine.  I'll try to upgrade to 2.4 ASAP.


Thanks!
Roger

-- 
Roger Leigh

                Printing on GNU/Linux?  http://gimp-print.sourceforge.net/
                GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.



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