Adding a "Full Screen" menu item on Mac OS X?

General chat related to ScummVM, adventure gaming, and so on.

Moderator: ScummVM Team

Post Reply
User avatar
eisnerguy1
Got a warning
Posts: 42
Joined: Mon Feb 27, 2012 10:06 am

Adding a "Full Screen" menu item on Mac OS X?

Post by eisnerguy1 »

So, I was wondering if there was a way to add a "Full Screen" menu item on Mac OS X? I know that the file I would need to edit is:
/backends/platform/sdl/macosx/appmenu_osx.mm

but, every thing I've tried only produces a greyed-out menu item. Here's a few examples of the code I've tried:

Code: Select all

 // Add "Full Screen" menu item 
    nsString = constructNSStringFromCString(_("Full Screen"), stringEncoding);
    menuItem = [[NSMenuItem alloc] initWithTitle:nsString action:@selector(fullscreen:) keyEquivalent:@"\r"]; 
    [setKeyEquivalentModifierMask:NSAlternateKeyMask | NSCommandKeyMask]; 
    [windowMenu addItem:menuItem]; 
    [nsString release]; 



    // Add "Full Screen" menu item 
   nsString = constructNSStringFromCString(_("Full Screen"), stringEncoding); 
   menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:nsString action:@selector(fullscreen:) keyEquivalent:@"\r"]; 
   [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask)]; 
Any help/suggestions would be greatly appreciated.
Botje
Posts: 207
Joined: Thu Feb 28, 2013 5:48 pm

Re: Adding a "Full Screen" menu item on Mac OS X?

Post by Botje »

This seems to suggest the selector you want is "toggleFullScreen:", maybe?

https://developer.apple.com/library/mac ... e_txt.html

And this suggests a "setEnabled:" method,

https://developer.apple.com/library/mac ... Items.html

Hope that helps, I don't have access to an OSX machine to try it right now
Post Reply