[no subject]



I see there are some pieces of the api where Glib::RefPtr is used, and
some others where it's not used at all. As gtkmm 3.0 approaches, there's
an opportunity to break API and ABI.

I would suggest to treat every object in the same way. gtk+ uses
reference counting.
What I would suggest is something that gobjectconsume
(http://live.gnome.org/GObjectIntrospection/GObjectConsume see
examples)
already does:

to wrap the c type in this way:

Gtk::Button button("push me");
Gtk::Button samebutton = button; //increases reference count.

This makes the usage in c++ easier I think. Could this be done for every class?
Instead of using explicit Glib::RefPtr, you just use it like above.
When the last reference
to the button dies, the button is deleted. This way you can return
widgets from functions in
an easy way, even you can pass by value without worrying. I find it
easier and more natural to work
in this way even if it's not the usual thing in c++ (operator= usually
means deep copy).


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