X button

noferat

04-01-2011 17:49:18

How to catch an event click on the button X, a window type WindowCSX, ie how to access the button X?
Thanks.

Altren

04-01-2011 22:30:02

window->eventWindowButtonPressed += MyGUI::newDelegate(this, &DemoKeeper::notifyWindowButtonPressed);

//...

void DemoKeeper::notifyWindowButtonPressed(MyGUI::Window* _sender, const std::string& _name)
{
if (_name == "close")
{
// for example you can close (destroy) window
MyGUI::WidgetManager::getInstance().destroyWidget(_sender);
}
}

noferat

04-01-2011 22:46:13

Thank you very much! :D