Cocoa Ogre::RenderWindow doesn't have a close button?

Problems building or running the engine, queries about how to use features etc.
Post Reply
notrodash
Halfling
Posts: 64
Joined: Sun Aug 19, 2012 9:42 pm
Location: Hampshire, United Kingdom

Cocoa Ogre::RenderWindow doesn't have a close button?

Post by notrodash »

Here are the traffic lights for my Ogre Application:
Image

And the traffic lights from Xcode (and pretty much every other OSX application):
Image

How do I enable the minimize and close buttons?
User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

Re: Cocoa Ogre::RenderWindow doesn't have a close button?

Post by masterfalcon »

TheSHEEEP
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 972
Joined: Mon Jun 02, 2008 6:52 pm
Location: Berlin
x 65

Re: Cocoa Ogre::RenderWindow doesn't have a close button?

Post by TheSHEEEP »

Well, it seems we have a bug in the URL BBCode...
I'd blame the Apple doc, though. Who creates weird URLs like those? ;)

I removed the url tags completely from your post and actually you have posted the same link twice :D
And then I noticed removing the tags completely screws up the link, guess that's why you put em there in the first place. Haha...
My site! - Have a look :)
Also on Twitter - extra fluffy
notrodash
Halfling
Posts: 64
Joined: Sun Aug 19, 2012 9:42 pm
Location: Hampshire, United Kingdom

Re: Cocoa Ogre::RenderWindow doesn't have a close button?

Post by notrodash »

Err, so how do i use those masks?

[edit]
what happened to the links?
User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

Re: Cocoa Ogre::RenderWindow doesn't have a close button?

Post by masterfalcon »

You can just OR them together for the features that you like. Or are you asking for more than that?
User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

Re: Cocoa Ogre::RenderWindow doesn't have a close button?

Post by masterfalcon »

You can just OR them together for the features that you like. Or are you asking for more than that?
notrodash
Halfling
Posts: 64
Joined: Sun Aug 19, 2012 9:42 pm
Location: Hampshire, United Kingdom

Re: Cocoa Ogre::RenderWindow doesn't have a close button?

Post by notrodash »

masterfalcon wrote:You can just OR them together for the features that you like. Or are you asking for more than that?
Double post? Anyways, I got it working with this code:

Code: Select all

NSWindow *mainOgreWindow = [[NSApp windows] objectAtIndex:0];
[[mainOgreWindow standardWindowButton:NSWindowCloseButton] setEnabled:TRUE];
[[mainOgreWindow standardWindowButton:NSWindowMiniaturizeButton] setEnabled:TRUE];
The Objective-C syntax is weird... :?
But it works :D.

Image
glennr
Greenskin
Posts: 126
Joined: Thu Jun 05, 2008 3:26 am
Location: Thames, New Zealand
x 9

Re: Cocoa Ogre::RenderWindow doesn't have a close button?

Post by glennr »

masterfalcon wrote:You can just OR them together for the features that you like. Or are you asking for more than that?
Is there a way to do this from the Ogre API? I'm guessing not, in which case, how does one create the window in such a way that the flags can be set?
User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

Re: Cocoa Ogre::RenderWindow doesn't have a close button?

Post by masterfalcon »

It shouldn't be too terribly difficult. Something like this perhaps, assuming that you already have a pointer to your render window.

Code: Select all

NSWindow *winHandle = NULL
mWindow->getCustomAttribute("WINDOW", &winHandle);
[[winHandle standardWindowButton:NSWindowCloseButton] setEnabled:TRUE];
[[winHandle standardWindowButton:NSWindowMiniaturizeButton] setEnabled:TRUE];
Note that since this uses Objective-C API's this should be in a .mm file.
Post Reply