Newer version of Enhanced Text widget available 
Author Message
 Newer version of Enhanced Text widget available

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

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

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 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"

Currently etext is based on tk4.0b3 text widget, and Perl part is
based on (patched) Tk-b4.

Hypertext document is reachable on


Get the distribution (say, from Pick up the latest copy
of the etext*.tar.gz. Then read 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!


misprints and so on. In fact contact me anyway if you tried this
widget, I would appreciate your feedback.

Tue, 18 Nov 1997 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Newer version of Enhanced Text widget available

2. New version of Archive::Tar (0.06) available

3. New version of C-like interpreter available

4. Perl and English (was Re: New version of C-like interpreter available)

5. perl vs tcl (was Re: New version of C-like interpreter available)

6. New version of MSDOS Bigperl4 available

7. My Enhanced MS-DOS 4.010 Perl is Available

8. new edition (0.3b) of Texinfo version of the perl manual available

9. New version of the Angel Network Monitor available

10. PERCEPS: The Perl C++ Surveyor, New Version 1.2 available

11. CAPE (Clips + Perl): New Version Available

12. Text::Template version 1.10 is available


Powered by phpBB® Forum Software