Menu Structure

Menu Structure

The menu structure for GNUstep apps is different when they’re running on macOS than on other platforms. macOS has a special “app menu” named after the app that contains the About, Settings, Services, and Quit items, among others.

On other platforms, the GNUstep menu structure follows the NeXTstep/OpenStep convention, in which the first menu is “Info”, which contains the “Info Panel…”, “Preferences”, and “Help” items. The Services menu is at the top level of the app’s menu bar, as are the hide and quit menu items. Use this structure on non-macOS desktop platforms, regardless of whether the active theme draws a vertical, NeXT-style menu, or a horizontal, Apple- or Windows-style menu bar.

As an example, a menu that you create using Renaissance for macOS looks like this:

<menu type="main">
    <menu title="ExampleApp" type="apple">
        <menuItem title="About ExampleApp" action="orderFrontStandardAboutPanel:"/>
        <menuSeparator/>
        <menuItem title="Settings..." action="showSettings:" keyEquivalent=","/>
        <menuSeparator/>
        <menu title="Services" type="services"/>
        <menuSeparator/>
        <menuItem title="Hide ExampleApp" action="hide:" keyEquivalent="h"/>
        <menuItem title="Hide Others" action="hideOtherApplications:" keyEquivalent="h" keyEquivalentModifier="option"/>
        <menuItem title="Show All" action="unhideAllApplications:"/>
        <menuSeparator/>
        <menuItem title="Quit ExampleApp" action="terminate:" keyEquivalent="q"/>
    </menu>
    <menu title="File">
        <!-- ... -->
    </menu>
    <menu title="Edit">
        <!-- ... -->
    </menu>
    <menu title="Window" type="windows">
        <menuItem title="Minimize" action="performMiniaturize:" keyEquivalent="m"/>
    </menu>
    <menu title="Help">
        <menuItem title="TypingPool Help" action="showHelp:"/>
    </menu>
</menu>

The same menu looks like this for other platforms:

<menu type="main">
    <menu title="Info">
        <menuItem title="Info Panel..." action="orderFrontStandardAboutPanel:"/>
        <menuItem title="Preferences..." action="showSettings:"/>
        <menuItem title="Help..." action="showHelp:"/>
    </menu>
    <menu title="File"> 
        <!-- ... -->
    </menu>
    <menu title="Edit">
        <!-- ... -->
    </menu>
    <menu title="Window" type="windows">
        <!-- ... -->
    </menu>
    <menu title="Services" type="services"/>
    <menuItem title="Hide" action="hide:" keyEquivalent="h"/>
    <menuItem title="Quit" action="terminate:" keyEquivalent="q"/>
</menu>

For more information on creating menus in Renaissance, see Adding a menu.