The Edit Class

The Edit class, derived from File, is a top-level window that contains an emacs-like editor with emacs-like key bindings. It has full capabilities for editing text, saving files, etc. The help window gives additional information.

You may create an instance of the Edit class as follows:

set e [::tycho::view Edit]
To read a file into the text widget, try
$e insertFile
There are many public methods associated with this class. See the class documentation for details.

This megawidget, the Edit class, can be used stand-alone inside any other widget or window. For example, the Query class uses Edit for multi-line entries.

Notice that you can enter text into the text window. If you are an emacs user, you will find the keystrokes used for navigating through the text familiar. To delete the above example:

delete object [$e displayer windowName]
Edit has a number of options. For example:
set ee [::tycho::view Edit \
	[list -text "Initial text in the text widget" \
	 -readonly 1 \
	 -textwidth 60 \
	 -scrollbar 0 \
	 -textheight 20]]
Notice that because of the -readonly option, you cannot modify the text. You can change this, and insert more text as follows:
$ee configure -readonly 0
$ee insertData " Here is some more text"
There are a large number of other public methods for Edit. See the class documentation. To delete the above example:
delete object [$ee displayer windowName]

Tycho Home Page


Copyright © 1996, The Regents of the University of California. All rights reserved.
Last updated: 96/11/30, comments to: eal@eecs.berkeley.edu