GNUstep-Gui

GNUstep-Gui

GNUstep make and NEEDS_GUI

By default, GNUstep make encodes assumptions about whether it should link your target to the GUI framework (libs-gui on most platforms, AppKit on macOS). The default is yes for apps, and no for frameworks, libraries, and tools.

To change this, modify your GNUmakefile to set one of these variables to either yes or no:

  • NEEDS_GUI: applies to all targets in the GNUmakefile.
  • [product_name]_NEEDS_GUI: applies to the specific product. For example, if your tool is called MyTool, and it needs to link to the GUI framework, set MyTool_NEEDS_GUI = yes.

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.

Renaissance Forms

An NSForm is a matrix of NSFormCell objects that associate labels with text fields.

To create one in Renaissance, use the <form/> element, where each child is a <formItem>, as in this example:

<form>
	<formItem id="idField" title="User ID:"/>
	<formItem id="emailField" title="Email Address:"/>
</form>

You can’t nest arbitrary views, for example NSTextField, inside a Renaissance form. Consider whether you need to use NSForm at all, or whether you can lay out text fields in the view directly instead.

Split View Orientation

In AppKit, NSSplitView’s -isVertical/-setVertical: property refers to the orientation of the divider, not the axis on which the views are ordered. In other words, a split view with isVertical equal to YES has a leading view (on the left in locales that read left-to-right), and vertical dividers splitting subviews that are organized horizontally. A split view with isVertical equal to NO has a top view, and horizontal dividers splitting subviews that are organized vertically.

Split View Sizing

An NSSplitView might assign a zero size to a subview that doesn’t request an explicit size. Provide an explicit initial size, and use autoresizing masks or autolayout constraints that allow the subview to occupy the space provided by the split view.

In Renaissance, use the hexpand attribute for horizontal stretching, and the vexpand attribute for vertical stretching.