Next Previous Up Top Contents Index

7.5 A tour of frames

7.5.1 Creating frames and displaying them on-screen

To create an instance of a frame class, use make, as you would any other class. To display an instance of a frame on the screen, use the function start-frame. This takes as an argument a name bound to an existing frame, or an expression (including function and macro calls) that evaluates to a frame instance.

For example, to create a simple frame that contains a single button, use the following code:

start-frame(make(<simple-frame>, 
                 title: "Simple frame", 
                 layout: 
                   make(<push-button>, 
                        label: "A button on a simple frame")));

Figure 7.27 A simple frame

Note that normally you should define your own subclasses or <simple-frame> and call start-frame on instances of these, rather than creating direct instances of <simple-frame>.


Building Applications Using DUIM - 26 May 1999

Next Previous Up Top Contents Index