Path: usenet.cis.ufl.edu!usenet.eel.ufl.edu!news.mathworks.com!uhog.mit.edu!bloom-beacon.mit.edu!news.starnet.net!wupost!howland.reston.ans.net!cs.utexas.edu!math.ohio-state.edu!scipio.cyberstore.ca!nntp.cs.ubc.ca!psgrain!nntp.teleport.com!usenet
From:
[email protected] (Ilya Zakharevich)
Newsgroups: comp.lang.perl.announce,comp.lang.perl.misc,comp.lang.perl
Subject: Newer version of Enhanced Text widget available
Date: 2 Jun 1995 03:46:09 GMT
Organization: Department of Mathematics, The Ohio State University
Lines: 112
Approved:
[email protected] (comp.lang.perl.announce)
Message-ID: <
[email protected]>
NNTP-Posting-Host: linda.teleport.com
Xref: usenet.cis.ufl.edu comp.lang.perl.announce:24 comp.lang.perl.misc:297 comp.lang.perl:51122
Enhanced Text widget widget adds a new form of annotation to the text
widget of tk that makes possible _arbitrary_ representation of its
fields on the screen.
Version 0.4 is made available on
file://ftp.math.ohio-state.edu/pub/users/ilya/
It is based on version 4.0b3 of tk and b4 of Tk.
Below is the README file from the distribution:
Etext is a drop in replacement for the Tk text widget. Currently the
only difference (if we forget about bugs) is the addition of another
type of text annotation: a block. Block have an internal structure,
but the ultimate elements of this structure are identical to the rows
in the text widget. All the editing commands work on blocks as well.
The main difference between blocks and other possible annotations of
the text widget is that blocks can properly nest in an arbitrary way,
and that blocks perform a geometry management over its contents. This
geometry management is governed by the code in interpreted language
(say, TCL). Most features of blocks can be emulated by sufficiently
deep hierarchy of embedded windows, but making this hierarchy easily
editable can be a nontrivial exercise.
Some examples what can be done by blocks:
wise tabulation,
* wise super- and subscripts,
* fractions,
* radicals,
* labeled equations,
* editable buttons.
Stars denote blocks with geometry management coded in the demo TCL
script.
The distribution of etext contains replacement tkText*.[ch] files,
differences with the base Tk version, and difference of Makefiles to
make separate installation smaller. It also contains Makefile.my that
can be used for reference purpose. The subdirectory doc contains the
pod documentation file and the manpage and hypertext documents
produced from this pod. Documentation contains all the supported
features of the widget, discusses some features that can be supported
in some other release, and mini-tutorial on creating a "pedestal"
block.
Currently etext is based on tk4.0b3 text widget, and Perl part is
based on (patched) Tk-b4.
Hypertext document is reachable on
ftp://ftp.math.ohio-state.edu/pub/users/ilya/etext.html
INSTALLATION:
Get the distribution (say, from
ftp://ftp.math.ohio-state.edu/pub/users/ilya). Pick up the latest copy
of the etext*.tar.gz. Then read INSTALL.
TESTING
See INSTALL.
The following works under tcl, most parts work under perl too.
./wish demo/etext.tcl
The nontrivial actions in the resulting widget are bound to keypresses
with Control- and Meta- modifiers simultaneously. They are:
n Reload the source.
q Quit
r/R switch on/off red foreground on selection.
b/B switch on/off blue background on selection.
s/S switch on/off small font on selection.
c insert empty superSub block around insertion point.
f insert empty fraction around insertion point.
e insert empty equation with "()" as a label around
insertion point.
d insert empty radical around insertion point.
m insert the "pedestal" block from the tutorial.
t insert the "tabulation" block from the tutorial.
If selection is active when you create a block with above keybindings,
the block is created "around" selection.
Additional keybindings: F10 converts selection to a "minimal" block,
i.e., block with default geometry management: parts are placed one
under another. F1, F2, F3 create some precooked samples of "minimal"
blocks, F4 and F5 insert precooked samples of superSub block.
Return inside block splits block element in two, Control-Return splits
deeper (well, you better look into documentation to understand what it
means). Deep split is used in superSub block to denote the boundary
between multiple super- and sub-scripts.
This means that to separate superscript of subscripts you should press
Return, the same for numerator and denominator.
It is good to read the documentation before running the demo, but
editing of blocks should be highly intuitive. To delete block, select
it and delete, do demolish it into components erase a boundary of a
block. To join two components erase the boundary between them. Thats all!
CONTACTING ME
email
[email protected] if you find bugs, missing features,
misprints and so on. In fact contact me anyway if you tried this
widget, I would appreciate your feedback.