On Thu, 09 Mar 2006 08:27:51 -0600
Bob Caryl <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> >The method on_row_activated is not a member-function, and this I
> >think is very dirty - but I didnt find a way to give the CALLBACK() a
> >member-function. Isnt there a way to do it like this :
> >
> > CALLBACK(&MyTreeView::on_row_activated) ?
> >
> Use the macro G_CALLBACK.

One issue present here is that your member function probably wants to
know what intstance it's associated with - otherwise much mayhem will
ensue.

Now, my understanding of C++ in this area may be faulty, but I don't
know that C++ will automatically associate the an instance with the
function pointer and make everything work.

What I usually do in this case is make my callback a friend function,
and then set it up so the instance is passed in as the callback's user
data (most callbacks I've encountered allow for user data). The first
line of my callback function then casts this user data pointer to a
pointer to an instance of the class, and the friend function can
pretend to be a class member.

- Michael

-- 
mouse, n: a device for pointing at the xterm in which you want to type.
                -- Fortune
_______________________________________________
gtkmm-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gtkmm-list

Reply via email to