::tycho::ListBrowser
-
Source File -
Contents:
itk_option
- public methods
- protected methods
- protected variables
seeFragment
method of the target editor. It may be a null string, {}, in which case
the file is simply opened.
In an HTML file, it can be the name associated with any named anchor.
In a text file it could be a string of the form {line linenumber}
or {range start end}, where start and end are of the form line.character.
If an entry in the index has only two items, then they are:
If a hyperjump is taken into an index file, and a point is specified, then the index is searched for a matching entry. If a single matching entry is found, then the link is followed for that entry. Otherwise, the index is displayed with all matching entries shown.
If the -file option is given, that file is read for the contents of the listbox. Moreover, the directory of that file is used for relative filenames referenced by the index. Otherwise, the current working directory is used for relative file names.
The format of the file is that of an index, a list of two items. It can contain comment lines, which begin with a pound sign (#). These are ignored.
The example below opens up the tycho index
set win [::tycho::IndexBrowser [::tycho::autoName .ib] \
-file [file join $TYCHO lib idx tycho.idx]]
$win centerOnScreen
-file
currentPoint
help
hyperJump
filename {point {}}
::tycho::expandPath
and
open the resulting file with ::tycho::File::openContext
,
which will choose an editor based on the filename extension. Finally,
invoke seeFragment
to view the specified point within the
file. The format for the point argument depends on the type of
file being opened. For HTML files, it will normally be the name of an
anchor in the file. For text files, it will normally be either "{line
linenumber}" or "{range start end}", where
start and end have the form
linenumber.characternumber.
seeFragment
point
processItem
filename
setContents
contents
CWD
entries