Re: slot from a reference pointer



Paul Davis wrote:
> On Wed, 2006-10-11 at 21:15 +0300, Paul Pogonyshev wrote:
> > Hi,
> > 
> > Is there a standard way of getting a sigc++ slot from Glib::RefPtr to
> > an object?  I know that I can `steal' the object using operator->(),
> > but is there a standard way?
> 
> its a bad idea anyway. i wrote last month about the perils of using
> boost::shared_ptr<T> in slots. it makes life quite complicated.

All Gtkmm objects inherit sigc::trackable (AFAIK), so it makes little
sense to add a reference if you create a slot for an object.  If you
_really_ want to make slot keeping object alive, you could add a
reference by hands.  If there is no standard way, I'll implement my
own, since I consider benifits (e.g. binding Gtk::Action::set_sensitive)
far more important than drawbacks of probably losing slot because object
is not used anymore.

Paul



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