Next Previous Up Top Contents Index

2.3 Creating the basic sheet hierarchy

2.3.3 Adding a radio box

There is one aspect of the initial design that you have not yet incorporated into the structure: the radio box. This serves two purposes in the application:

1. It lets you choose the priority for a new task.
2. It displays the priority of any task selected in the list.

The code to create the radio box is as follows:

make (<radio-box>, label: "Priority:", 
     items: #("High", "Medium", "Low"), 
     orientation: #"vertical");

Notice that the orientation: init-keyword can be used to ensure that each item is displayed one above the other.

It is probably best to place the radio box immediately below the Remove task button. To do this, you need to add the definition for the radio box at the appropriate position in the call to vertically.

  (horizontally ()
     make (<list-box>, items: #(), lines: 15); 
     vertically () 
       horizontally () 
         make (<text-field>, label: "Task text:");
         make (<push-button>, label: "Add task");
       end;
       make (<push-button>, label: "Remove task");
       make (<radio-box>, label: "Priority:", 
             items: #("High", "Medium", "Low"), 
             orientation: #"vertical");
     end);


Building Applications Using DUIM - 26 May 1999

Next Previous Up Top Contents Index