Re: Gtk::Widget::reparent(): To deprecate or not to deprecate?

On Mon, 2014-06-09 at 10:12 +0200, Kjell Ahlstedt wrote:
Commit adds

//TODO: Maybe keep this or implement it ourselves, 
//because the C API now requires manual ref/unrefing to stop remove()
and add() from breaking things.

I didn't think of that complication when I deprecated
Widget::reparent(). It's an issue only for managed widgets, such as
    Gtk::Button* button1 = Gtk::manage(new Gtk::Button());
Other widgets have a reference count > 0 even when they are not
inserted in a Gtk::Container.

How about just adding to the deprecation message that the
Container::remove()/Container::add() combination can't be used with
managed widgets? Would that be an acceptable restriction?

I'd prefer to just undeprecate it, and reimplement it using a simple
ref/remove/add/unref. I think maybe we even had it like that in gtkmm
before it was in GTK+.

Murray Cumming
murrayc murrayc com

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