Re: [gtkmm] Removing a widget from a container temporarily

On Mon, 2004-02-16 at 09:21, Tor Arvid Lund wrote:
> Samuel wrote:
> > hpaned->remove(*viewport1);
> > hpaned->remove(*viewport2);
> > table->remove(*hpaned);
> > table->attach(*viewport1, 0, 1, 0, 1, Gtk::FILL, Gtk::FILL, 0, 0);
> > ------------------
> > 
> > This segfaults at "table->attach":
> I think if you just call viewport1->reference(); before the remove you 
> will be OK.

That sounds less than ideal. reparent() proably does what you want. Or
you could just choose not use manage().

I don't think that there is a clear way to remove a manage()ed widget
from a container without destroying it.

I guess remove() should not destroy the widgtet in C++, and you should
probably add a bug about that. But then who would destroy it? You'd need
to be sure to add it to something else, or unmanage it.

Murray Cumming
murrayc murrayc com

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