The View and Displayer Classes

Tycho's View and Displayer classes act in concert to present a window to the user containing graphics and text editors, and other kinds of display. A Displayer is a top-level window; a View is a widget that can be placed into a Displayer. Displayer is used as-is; View is an abstract class that is subclassed in order to provide appropriate functionality. Displayers can contain more than one View; some Views can themselves contain other Views.

Note: Although the Displayer-View architecture is designed to support multiple views of data within the one top-level window, this functionality is not yet used anywhere within Tycho. The rest of this description will only place a single view into each displayer.

Views

The ::tycho::view proc is a shortcut procedure to open a Displayer/View combination.

The following command will create a Displayer that contains a View with a Edit widget inside it.

set myview [::tycho::view Edit]
To close the Displayer, use
delete object [$myview displayer]
See the view documentation for further information.

Displayers

Creating a new Displayer is the same as creating any other widget:

set myDisplayer [::tycho::autoName .myDisplayer]
::tycho::Displayer $myDisplayer
$myDisplayer centerOnScreen
You will see an empty displayer containing a status bar. A view is created as a child of the displayer; for example, we can create a text editor and place it into its displayer:
::tycho::Edit $myDisplayer.e
$myDisplayer attachView $myDisplayer.e
$myDisplayer showView $myDisplayer.e
The Edit widget has placed itself into the Displayer and configured its menubar. To better illustrate this, we'll just use an empty View. First delete the Edit view:
$myDisplayer destroyView $myDisplayer.e

Finally, deleting a Displayer and the Views contained in it is the same as deleting any other widget:

delete object $myDisplayer

Decorator classes
Displayer class documentation
View class documentation
Tycho Home Page


Copyright © 1996-1998, The Regents of the University of California. All rights reserved.
Last updated: 03/16/98, comments to: tycho@eecs.berkeley.edu