5 Laying Out CAPI Panes
For instance, suppose you want to arrange the elements in your window as shown in Figure 5.3. The two buttons are shown on the right, with the text input pane and a message on the left. Immediately below this is the editor pane.
Figure 5.3 A sample layout
The layout in Figure 5.3 can be achieved by creating two row layouts: one containing the display pane and a button, and one containing the text input pane and the other button, and then creating a column layout which uses these two row layouts and the editor.
(setq row1 (make-instance 'row-layout :description (list message button1)))
(setq row2 (make-instance 'row-layout :description (list text button2)))
(contain (make-instance 'column-layout :description (list row1 row2 editor)))
Figure 5.4 An instantiation of the sample layout
As you can see, creating a variety of different layouts is simple. This means that it is easy to experiment with different layouts, allowing you to concentrate on the interface design, rather than its code.
Generated with Harlequin WebMaker