Next Previous Up Top Contents Index

7.5 A tour of frames

7.5.2 Useful properties of frames

You can specify a wide variety of properties for any instance or class of frame. This section describes some of the most common properties you might want to use. Naturally, when you create your own classes of frame by subclassing <simple-frame>, you can define new properties as well. For more information on creating your own frame classes, see Section 7.5.3 on page 125, and review the description of the task list manager in Chapter 3 and Chapter 4.

The frame-pane property is used to define every discrete element in a frame class. Exactly what constitutes a discrete element is, to a large extent, up to the programmer. As a guide, every pane definition creates an accessor just like a slot accessor, and so any element whose value you might want to retrieve should be defined as a pane. Individual gadgets, layouts, and menus are all generally expressed as panes in a frame definition. When defining a frame class, use the pane option to define each pane.

The frame-layout property is used to specify the topmost layout in the sheet hierarchy that forms the contents of a frame class. This take an instance of any subclass of <layout> which may itself contain any number of gadgets or other layouts as children. The children of this layout are themselves typically defined as panes within the same frame definition. When defining a frame class, use the layout option to define the topmost layout.

Other major components of a frame can be specified using frame-menu-bar, frame-tool-bar, and frame-status-bar. Each property takes an instance of the corresponding gadget class as its value. You can also use frame-command-table to specify a command table defining all the menu commands available in the menu bar. All of these slots have corresponding options you can set when creating your own frame classes.

To determine the initial size and position of any frame, use frame-width, frame-height, frame-x, and frame-y. Each of these properties takes an integer argument that represents a number of pixels. Note that frame-x and frame-y represent the position of the frame with respect to the top left hand corner of the screen.

Sometimes, it may be useful to fix the height or width of a frame. This can be done using frame-fixed-width? and frame-fixed-height?, both of which take a boolean value. Setting frame-resizable? to #f fixes both the width and height of a frame.


Building Applications Using DUIM - 26 May 1999

Next Previous Up Top Contents Index