7.2 An Example interface
define-interface
call to see how this interface was built. The first part of the call to define interface is shown below:(define-interface demo () ()This part of the macro is identical to
defclass
-- you provide:interface
)define-interface
call occurs after thesedefclass
-like preliminaries. The remainder of adefine-interface
call lists all elements that define the interface's appearance. Here is the:panes
part of the definition:(:panes (page-up push-button :text "Page Up") (page-down push-button :text "Page Down") (open-file push-button :text "Open File"))Two arguments -- the name and the class -- are required to produce a pane. You can supply slot values as you would for any pane.
Here is the:layouts
part of the definition:
(:layouts (row-of-buttons row-layout '(page-up page-down open-file)))Three arguments -- the name, the class, and any child layouts -- are required to produce a layout. Notice how the children of the layout are specified by using their component names.
The interface information given so far is a series of specifications for panes and layouts. It could also specify menus and a menu bar. In this case, three buttons are defined. The layout chosen is a row layout, which displays the three buttons side by side at the top of the pane.
Generated with Harlequin WebMaker