SOLVED!
[HR][/HR]
hey,
i have recently setup GWEN with SFML 2 and i was wondering how you add a callback to a button for when you click it.
i tried:
[code]
void test(Gwen::Controls::Base* pControl)
{
std::cout << ":D" << std::endl;
}
...
Gwen::Controls::Button* pButton = new Gwen::Controls::Button(pWindow);
pButton -> SetText("Sexy ass button");
pButton -> onPress.Add(pButton, &test);
[/code]
and it spews out this:
[code]
1>f:\gwen\include\gwen\events.h(127): error C2440: 'static_cast' : cannot convert from 'void (__cdecl *)(Gwen::Controls::Base *)' to 'Gwen::Event::Handler::Function'
1> There is no context in which this conversion is possible
1> D:\visual studio 2010\projects\GWEN\GWEN\main.cpp(63) : see reference to function template instantiation 'void Gwen::Event::Caller::Add<void(__cdecl *)(Gwen::Controls::Base *)>(Gwen::Event::Handler *,T)' being compiled
1> with
1> [
1> T=void (__cdecl *)(Gwen::Controls::Base *)
1> ]
[/code]
can anyone help me please?
This belongs to programming...
oops sorry :l
solved it anyways - ill change it.
Sorry, you need to Log In to post a reply to this thread.