1

I'm writing a game that will run in a fullscreen window. I'm using Xojo to code it (therefore any boolean window properties that might be availble in Xcode / Interface Builder are not an option).

Is there a plist key/value I can set in my app that will hide the application menubar and the dock when my window is set to full screen?

Needs to work on Yosemite.

Garry Pettet
  • 8,096
  • 22
  • 65
  • 103

2 Answers2

1

Get the macoslib

It contains extensions for NSWindow that can do this. Just search the project for "fullscreen".

There is also a demo. If you run the project, open the menu bar: Examples -> Cocoa -> NSWindow. That window has a "Toggle Fullscreen" button for testing.

Thomas Tempelmann
  • 11,045
  • 8
  • 74
  • 149
  • Thanks Thom, whilst this works, it shows a one second animation of the window moving to fullscreen. Since this is a game, I need a way to just launch the window at full screen rather than stretch to fullscreen - it just looks weird. Thoughts? – Garry Pettet Apr 12 '15 at 10:13
  • I know there are some older APIs for this purpose, maybe they do this better, but I do not have them handy right now. Also, the macoslib function works on a window, and you need the app-wide setting instead, it appears. Have you checked if the MBS plugins offer a function for that, in case you are not comfortable writing your own declares? – Thomas Tempelmann Apr 13 '15 at 11:45
1

Here is what you need to place in the window Open event :

  self.LiveResize = False
  self.MenuBarVisible = false
  self.FullScreen = true

First line turns off animation,

Second line turns off UI elements (dock and menu bar),

Third line makes the window full screen

Mitch Match
  • 339
  • 4
  • 14