Subscribing to events
Posted: Thu Mar 17, 2005 09:13
hello, im back again, this time with a question about subscribing to events. Currently im attempting to create a console class object. Im having trouble subscribing to an editbox event. heres my code:
this appears to be the offending code:
heres the error i get:
term does not evaluate to function taking 1 arguments
an error is pulled up at this code spot:
.
any ideas? im sure its something i have done, but im not sure what to do next
Code: Select all
class CConsole{
public:
CConsole();
void load(std::string filename, CEGUI::WindowManager *wManager);
void show(bool s);
void hide();
void show();
void toggle();
void clear();
void addOutput(const char *fmt, ...);
bool eventHandler(const CEGUI::EventArgs& e);
private:
CEGUI::WindowManager *mWindowManager;
CEGUI::Window *mParentWindow;
CEGUI::FrameWindow *mFrame;
CEGUI::Listbox *mOutputList;
CEGUI::Editbox *mInput;
int mMaxItems;
bool mVisible;
};
this appears to be the offending code:
Code: Select all
CConsole::mInput->subscribeEvent(Editbox::EventTextAccepted,&CConsole::eventHandler);
heres the error i get:
term does not evaluate to function taking 1 arguments
an error is pulled up at this code spot:
Code: Select all
/* This class binds a copy of a functor. */
template <class Functor, typename Ret, typename Args>
class _functorBinder : public SubscriberInterface<Ret,Args>
{
public:
virtual Ret operator()(Args args) const
{
return d_f(args);
}
_functorBinder(const Functor& f) : d_f(f) {}
protected:
Functor d_f;
};
any ideas? im sure its something i have done, but im not sure what to do next