Gui window without close button

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Randajad
Posts: 59
Joined: Thu May 03, 2012 10:08 am

Gui window without close button

Post by Randajad »

How i can do it? I try to google, yes.
Simply win->getCloseButton()->drop() does segfault.
I need withdow without this annoying button. Why there is no "base_window" without buttons at all?
Sorry for my English, i'm from Russia.
If i makes mistakes in phrases you can correct me btw. ^_^
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Gui window without close button

Post by hendu »

Because that's not possible on all platforms. You can't dictate the window bar buttons on linux at all, for example. I don't think Mac allows you to remove the close button either, though it does let you disable min/max.

The windows-specific solution is to create your window using your desired winapi calls and then using createdeviceex.
Randajad
Posts: 59
Joined: Thu May 03, 2012 10:08 am

Re: Gui window without close button

Post by Randajad »

NOOOOOOOOOO!
I mean irrlicht's own in game gui window!
http://irrlicht.sourceforge.net/docu/cl ... indow.html
Sorry for my English, i'm from Russia.
If i makes mistakes in phrases you can correct me btw. ^_^
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Gui window without close button

Post by hendu »

Should have said so then ;)
CuteAlien
Admin
Posts: 9988
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Gui window without close button

Post by CuteAlien »

Use remove() instead of drop(). Drop() is for memory-management, don't ever use that if you haven't added a reference to an object. While remove() just removes a gui-element from the gui-environment so it's no longer rendered.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Randajad
Posts: 59
Joined: Thu May 03, 2012 10:08 am

Re: Gui window without close button

Post by Randajad »

Thanks for reply!
Okay, another question: is this safe to do this? I think, IGUIWindow also calls btn->remove() when it's destroying, or not?
Also i have question too: how i can disable window blinking when i press outside of the window?
Sorry for my English, i'm from Russia.
If i makes mistakes in phrases you can correct me btw. ^_^
CuteAlien
Admin
Posts: 9988
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Gui window without close button

Post by CuteAlien »

It's save calling remove several times (just won't do anything if it's already removed).

The short answer to disable blinking is - don't make it modal - this shows for modal windows that it's impossible to click outside. If you really don't want that behavior for modal windows you have to modify the engine in CGUIModalScreen::draw (just removing all code in there would do the trick).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Randajad
Posts: 59
Joined: Thu May 03, 2012 10:08 am

Re: Gui window without close button

Post by Randajad »

Thanks many times for the help! You are great!
Sorry for my English, i'm from Russia.
If i makes mistakes in phrases you can correct me btw. ^_^
gerdb
Posts: 194
Joined: Wed Dec 02, 2009 8:21 pm
Location: Dresden, Germany

Re: Gui window without close button

Post by gerdb »

maybe getCloseButton()->setVisible(false);
Post Reply