You can use the function contain to run any of the examples above using the interactor available in the Dylan environment. This function lets you see the results of your work immediately, without the need to compile any source code or build a project, and is extremely useful for experimenting interactively when you are developing your initial ideas for a GUI design.
The contain function takes any expression that describes a hierarchy of sheets as an argument. It creates a frame which contains this sheet hierarchy, and displays the resulting frame on the screen.
Thus, to run any of the code segments shown in this chapter, simply pass them to contain as an argument. Here are two examples, adapted from earlier examples in this chapter, as illustrations of how to use contain.
contain (horizontally ()
make (<text-field>, label: "Task text:");
make (<push-button>, label: "Add task");
end);
contain (make (<text-field>, label: "Task text:"));
At this point, take a few minutes to go back over this chapter and practice using contain to run the code fragments that have already been discussed.