|
Boost Users : |
Subject: [Boost-users] boost::bind and Motif
From: Sven Bauhan (sven.bauhan_at_[hidden])
Date: 2012-05-02 08:57:06
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<void (&)(void*, XtIntervalId*), boost::_mfi::dm<void
()(void*, XtIntervalId*), geo::AnimationController>,
boost::_bi::list1<boost::_bi::value<geo::AnimationController*> > >' to
'void (*)(void*, XtIntervalId*)' for argument '3' to 'XtIntervalId
XtAppAddTimeOut(_XtAppStruct*, long unsigned int, void (*)(void*,
XtIntervalId*), void*)'
Can someone explain, what I did wrong?
Thanks, Sven
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net