[Solved] Binding callbacks


31-07-2008 18:38:51

I'm having some problems binding delegates to a couple of events.

These handlers:
hscroll->eventScrollChangePosition = MyGUI::newDelegate(this, &GUIListener::slideVolume_PositionChanged);
cbx->eventComboChangePosition = MyGUI::newDelegate(this, &GUIListener::ddlResolution_IndexChanged);

are giving me compilers warnings as if the prototypes for the methods were incorrect.

The methods are prototyped such:
void ddlResolution_IndexChanged(MyGUI::WidgetPtr sender, int idx);
void slideVolume_PositionChanged(MyGUI::WidgetPtr sender, int _pos);

int was supposed to be unsigned.....


25-08-2008 23:42:42

/*regula o volume do som ambiente (background sound)*/
MyGUI::HScrollPtr scrollVolAmb = gui->findWidget<MyGUI::HScroll>("volMusica");
scrollVolAmb->eventScrollChangePosition = MyGUI::newDelegate(this, &AplicationListener::volumeAmb);


void volumeAmb(MyGUI::WidgetPtr _widget, int _pos);

this error

.\src\AplicationListener.cpp(626) : error C2679: binary '=' : no operator found which takes a right-hand operand of type 'MyGUI::delegates::IDelegate2<TP1,TP2> *' (or there is no acceptable conversion)

Sorry for my English, it is translated by google


26-08-2008 15:11:42

/** Event : scroll tracker position changed.\n
signature : void method(MyGUI::WidgetPtr _sender, size_t _position)\n
@param _position - new tracker position
EventInfo_WidgetSizeT eventScrollChangePosition;