Next: 2.2 Creating a Window Up: 2 Adding a Window Previous: 2 Adding a Window

2.1 Window Attributes

Windows are represented in GNUstep by NSWindow objects. We are mainly interested in two attributes of a NSWindow object:
  1. 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);
  2. 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: 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