RE: [gtkmm] adding and removing widgets to/from fixed container



> From: Anastasios Bassoukos [mailto:abas aix meng auth gr] 
> > The troubles arise when I try to add again something that I 
> had previously removed. In this case I get assertion fail and 
> segmentation fault.
> 
> That happens because Container::remove() unreferences the 
> widgets. Nothing
> else references them, therefore they are destroyed.

This shouldn't be a problem unless you use Gtk::manage(). Actually, even if
you use Gtk::manage() it shouldn't be a problem - but it would take a
simple-as-possible test case to investigate it. People don't use Gtk::Fixed
so it might be a rare problem with just that container.

> Use Glib::RefPtr<Gtk::Widget> to keep track of them....

Glib::RefPtr<> is not really meant for Widgets.

Murray Cumming
murrayc usa net
www.murrayc.com 



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