Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>glut is creating menu bar items and even keyboard shortcuts on Mac OSX (just try Command+S and you'd be surprised...). There's no easy way to remove these things without accessing Cocoa. The GLUT source code from here shows where all that stuff is being implemented:</p> <p><a href="http://developer.apple.com/library/mac/#samplecode/glut/Introduction/Intro.html" rel="nofollow">http://developer.apple.com/library/mac/#samplecode/glut/Introduction/Intro.html</a></p> <p>In order to get rid of the Menus in GLUT, you have to do the following:</p> <ol> <li>#include "Cocoa/Cocoa.h" in your main.cpp file.</li> <li>right-click on your main.cpp file, select "Get Info", then in the "General" tab set your "File Type" to sourcecode.cpp.objcpp</li> <li>include the Cocoa framework in your xcode project</li> <li><p>add the following code after glutInit():</p> <pre><code>if (NSApp){ NSMenu *menu; NSMenuItem *menuItem; [NSApp setMainMenu:[[NSMenu alloc] init]]; menu = [[NSMenu alloc] initWithTitle:@""]; [menu addItemWithTitle:@"About..." action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""]; menuItem = [[NSMenuItem alloc] initWithTitle:@"Apple" action:nil keyEquivalent:@""]; [menuItem setSubmenu:menu]; [[NSApp mainMenu] addItem:menuItem]; [NSApp setAppleMenu:menu]; } </code></pre></li> </ol> <p>The code is by Tom de Grunt from here: <a href="http://www.degrunt.net/2010/09/22/using-nsmenu-outside-the-nib/" rel="nofollow">http://www.degrunt.net/2010/09/22/using-nsmenu-outside-the-nib/</a></p> <p>This will set up your application with nothing but an "About..." button within a menu with your Apps name. Just deleting the menu will cause a crash as GLUT expects a menu and has registered a callback for that.</p> <p>I have search up and down the web for an answer to this and hope that this will help others that ran into the same problem.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload