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.
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]
delete object [$myview displayer]
Creating a new Displayer is the same as creating any other
widget:
set myDisplayer [::tycho::autoName .myDisplayer]
::tycho::Displayer $myDisplayer
$myDisplayer centerOnScreen
::tycho::Edit $myDisplayer.e
$myDisplayer attachView $myDisplayer.e
$myDisplayer showView $myDisplayer.e
$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