Xref: utzoo comp.lang.c++:13630 comp.windows.open-look:1504 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!swrinde!mips!spool.mu.edu!munnari.oz.au!yoyo.aarnet.edu.au!sirius.ucs.adelaide.edu.au!augean.ua.OZ.AU!bubbles!pete From: pete@TIRS.oz.au (Peter Bartel) Newsgroups: comp.lang.c++,comp.windows.open-look Subject: Passing member functions Message-ID: <1991May24.052811.10218@TIRS.oz.au> Date: 24 May 91 05:28:11 GMT Organization: International Railroad Systems (Electronics) Lines: 38 When writing an XView program with C++, you can specify a function to be called when a button is pressed by: class my_class { virtual void member_func1(void); }; void my_class::member_func1(void) { extern void callback_routine(Panel_item, Event*); xv_set(button, PANEL_NOTIFY_PROC, callback_routine); } In the above case, callback_routine is an ordinary function; not a member of any class. My question is: how do I tell XView to use a member function as the panel notify procedure? What I want is something similar to the following (which doesn't work). class my_class { virtual void member_func1(void); virtual void member_func2(Panel_item, Event*); }; void my_class::member_func1(void) { xv_set(button, PANEL_NOTIFY_PROC, member_func2); } void my_class::member_func2(Panel_item item, Event *event) { fprintf(stderr, "hello"); } _______________________________________________________________________ Peter Bartel Senior Software Engineer International Phone: +61-8-232-1740 Railroad Faxstream: +61-8-232-2274 Systems E-mail: pete@TIRS.oz.au (Electronics) Snail: 209-217 Wakefield St, Adelaide, South Australia, 5000