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



Thanks for your reply.

Murray Cumming Comneon com wrote:

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
I use manage, but I use it from the Gtk::Window class, then add the widget to the Fixed container that is in the window as well.

- 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.
But fixed seems not to reimplement Container::remove, so I would expect the behaviour to be common for all containers. I will try to make a simple-as-possible test case and submit it to bugzilla..

Use Glib::RefPtr<Gtk::Widget> to keep track of them....
Glib::RefPtr<> is not really meant for Widgets.
Shall I then use standard pointers?

Regards,
Enrico





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