I am getting the compile error 'QuickGUI::Widget::addEventHandler' : function does not take 3 arguments in the following line of code:
button->addEventHandler(Widget::QGUI_EVENT_MOUSE_BUTTON_UP, &App::handler, this);
Do you have any suggestion?
Check QuickGUIWidget.h to see if the function "addEventHandler" takes 3 arguments.. (which it should)
What version are you using? That error message doesn't really make any sense.. If the library compiles correctly, that means it is already using that function call with 3 parameters. For example, look at QuickGUIWindow.cpp, in the constructor.
I actually had the same problem for a while, but after rebuilding a couple times, the problem went away. If a compiler were a TV or something, I'd say hit it a couple times, but since you can't, you just have to jiggle some things around in the code
The problem does go away eventually though!
KungFooMasta, I am using the version 0.9.5 v2 of QuickGUI (over the version 0.9.5), on Visual Studio 2005 SP2. It seems it compiled correctly. The addEventHandler on QuickGUIWidget.h is overloaded to accept 2 or 3 arguments. As thecaptain reported, it may be a configuration error on my IDE, as the problem disappears sometimes.
thecaptain, I have tried to compile several times but it is not still working. Do you remember if you had changed something on your project properties in order to get rid of that compile error?
I don't know what the problem could be.. all I can suggest is cleaning the library and then building it again.
Odd that the library compiles correctly and your app doesn't, considering the Window constructor creates a TitleBar, and adds event handlers to the TitleBar's Close Button.
Folks, the problem was on my code... After a lot of tries, when I removed all CEGUI references, a compile error showed my mistake. App::handler still had CEGUI arguments... Everything is working now.
I actually ran into this myself just now, and it was really confusing. My conclusion is that Visual Studio is producing an incorrect error message. Whenever you see the error message saying the function does not take 3 arguements, make sure the function you are referencing returns bool, and takes const EventArgs&. This should solve your problem every time. I made a NOTE: remark in the addEventHandler function.
Sorry to necropost, but I'm running into this exact same error.
All my code seems to be perfectly fine (copy and past for the most part) I've even tried moving things around.
Even rebuilt my solution like 3 times, and still no go.
(QuickGui editor and playpen compile fine....)
Sorry for the late response, I'm on vacation with no internet access.
You need to have the right signature, you can follow this
tutorial and it will show you how to register event handlers.