Next: 2.2 Creating a Window
Up: 2 Adding a Window
Previous: 2 Adding a Window
Windows are represented in GNUstep by NSWindow objects. We
are mainly interested in two attributes of a NSWindow object:
- its content rect, which is a NSRect describing
the rectangle covered by the internal area of the window; i.e.,
without all the decorations added by the window manager (title bar,
border, etc);
- its style mask, which is an unsigned int
describing the decorations of the window. A zero style mask is also
known as a NSBorderlessWindowMask, and means that the
window has no decorations at all. If the window needs to have
decorations, you need to set its style mask to a combination
(OR) of one or more of the following constants:
- NSTitledWindowMask = the window has a title bar;
- NSClosableWindowMask = the window can be closed by the
user (it has a close button);
- NSMiniaturizableWindowMask = the window can be
miniaturized by the user (it has a miniaturize button);
- NSResizableWindowMask = the window can be resized by
the user.
For example, a window which has a title bar, is closable and
miniaturizable will have a style mask of:
unsigned int windowMask = NSTitledWindowMask
| NSClosableWindowMask
| NSMiniaturizableWindowMask;
where | is the C operator for the logical OR.
While you might freely change the content rect of your window after
the window has been created, you can only set the style mask when the
window is first created. You can not change the style mask of the
window after creation.
Next: 2.2 Creating a Window
Up: 2 Adding a Window
Previous: 2 Adding a Window
2008-01-16