Page 1 of 1

Closing a window

Posted: Wed Sep 13, 2006 20:21
by Ludi
Hi,

I'm currently using 0.5.0RC2. How is it possible to close a window with a click on the "X"? Do I have to subscripe a special event, because when I currently click it, nothing happens.

And how can I disable the option to minimize the window to it's titlebar, when I double-click in the titlebar?

Thanks for the help and Greetings

Re: Closing a window

Posted: Wed Sep 13, 2006 23:14
by spannerman
Ludi wrote:Hi,

I'm currently using 0.5.0RC2. How is it possible to close a window with a click on the "X"? Do I have to subscripe a special event, because when I currently click it, nothing happens.



Yes you must subscribe to the EventCloseClicked event, e.g:

Code: Select all

myFrameWindow->subscribeEvent(FrameWindow::EventCloseClicked, Event::Subscriber(&MyClassName::closeWindow, this));


Then do something in the method e.g:

Code: Select all

bool MyClassName::closeWindow(const CEGUI::EventArgs& e)
{
   myFrameWindow->hide();
}


Ludi wrote:And how can I disable the option to minimize the window to it's titlebar, when I double-click in the titlebar?



Code: Select all

myFrameWindow->setRollupEnabled(false);


I think thats the method. Hope that helps.

Posted: Thu Sep 14, 2006 18:49
by Ludi
Thanks for your help!

Greetings