All Manuals > CAPI User Guide > 7 Laying Out CAPI Panes

NextPrevUpTopContentsIndex

7.3 Combining different layouts

You will not always want to arrange all your elements in a single row or column. You can include other layouts in the list of elements used in any layout, thus enabling you to specify precisely how panes in a window should be arranged.

For instance, suppose you want to arrange the elements in your window as shown in A sample layout. 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 7.3 A sample layout

The layout in A sample layout 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 7.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.

However, remember than each instance of a CAPI element must not be used in more than one place at the same time.


CAPI User Guide (Unix version) - 30 Aug 2011

NextPrevUpTopContentsIndex