Closing a window

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

User avatar
Ludi
Quite a regular
Quite a regular
Posts: 59
Joined: Sun Aug 13, 2006 12:33

Closing a window

Postby Ludi » Wed Sep 13, 2006 20:21

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

User avatar
spannerman
Home away from home
Home away from home
Posts: 330
Joined: Wed Jan 12, 2005 12:06

Re: Closing a window

Postby spannerman » Wed Sep 13, 2006 23:14

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.

User avatar
Ludi
Quite a regular
Quite a regular
Posts: 59
Joined: Sun Aug 13, 2006 12:33

Postby Ludi » Thu Sep 14, 2006 18:49

Thanks for your help!

Greetings


Return to “Help”

Who is online

Users browsing this forum: No registered users and 22 guests