
Hi,
I just tried to use boost::bind to create a function pointer from an
object method to define it as a Motif callback function:
class AnimationController {
public:
void timerCB( XtPointer, XtIntervalId* );
void startTimer() {
this->mTimeout = XtAppAddTimeOut( this->mAppContext,
ANIMATION_TIMESTEP,
boost::bind( &AnimationController::timerCB, this ), NULL );
}
...
};
For the definition of the Motif function:
XtIntervalId XtAppAddTimeOut(
XtAppContext /* app_context */,
unsigned long /* interval */,
XtTimerCallbackProc /* proc */,
XtPointer /* closure */
);
with
typedef void (*XtTimerCallbackProc)(
XtPointer /* closure */,
XtIntervalId* /* id */
);
But I get the following error:
../AnimationController.cpp: In member function 'void
geo::AnimationController::startTimer()':
../AnimationController.cpp:193: error: cannot convert
'boost::_bi::bind_t