Re: [gtkmm] Basic signal handling problem



Am 2002.10.26 19:01 schrieb(en) Murray Cumming:
On Sat, 2002-10-26 at 16:25, Mussol Trek wrote:
> I don't understantd it, because the documentation says
> that we can use any kind of function (static, class
> member, ....). But if I use a member function from a
> GTK derived class, such Gtk::Window, all it's correct.
> All handled class member functions must be from a Gtk
> derived class?
> Anybody can helps me? Thanks.

It's a libsigc++ limitation - the class needs to derive from
SigC::Object. gtkmm classes do derive from SigC::Object.

You can also #include <sigc++/class_slot.h> and use
SigC::slot_class() instead of SigC::slot() also for types that
don't derive SigC::Object. However, this is not recommended
in connection with dynamic allocation because if the object
passed into SigC::slot_class() is deleted the slot won't get
notified and segfaults on invocation.

Regards,

  Martin



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