Can buttons call functions with parameters?

liamrudel

02-02-2009 14:26:25

Hi, I have this code and it calls my function fine, but how do I call a function with parameters?

MyGUI::ButtonPtr button = mGUI->createWidget<MyGUI::Button>("Button", 10, 10, 150, 26, MyGUI::ALIGN_DEFAULT, "Main");
button->setCaption("Quit");
button->eventMouseButtonClick = MyGUI::delegates::newDelegate(this,&PlayState::testFunction);

void PlayState::testFunction(MyGUI::WidgetPtr _sender)
{
changeState(MenuState::getInstance());
}

Altren

03-02-2009 15:44:22

Can you show any example, what parameters do you need?