Now that Tk 4.0 (and Tcl 7.4) are released, the hypertools will be upgraded to
make use of these changes. This is version 1.1, with a few minor enhancements
and bugfixes from the original (1.0). Many changes will be required for Tk
4.0-compatibility, and this file will describe the changes to accompany Tk 4.0.
The Tk4.0 compatible version will not be released until after a stable release
of Tk4.0.


Basic Changes

Now that Tk allows binding tags to be used, we might use this to create a TH
binding tag for various widgets. Or use different binding tags for different
hypertools. (ie TH_Search_Text, TH_Paren_Entry, etc). The possibilities are
endless, but what are the pros and cons? Is it worth it?

XF probably won't be available to help with keysyms, so disable it until it
becomes available for Tk4.0. On second thought, don't do that...just warn the
user in TH's helppage that their XF must be compatible with Tk4.0. (Such an XF
doesn't exist yet.)

For Tk4.0, these tools should provide an option to use popup menus.

Functions that rely on width or length of a widget should figure out the actual
length/width instead of using configure -width/-height, which is the *requested*
size, not the *actual* size.


Hypertools:

browseth

(See the section at the end on Tk's default bindings for rationale behind
the following)

The paging keys depend on the -width and -height options, which are the
*requested* geometry, not the actual size of a widget.

***Browseth is getting divided into two hypertools, one will contain commands
made obsolete by Tk4.0 (people might still like to have them around), and the
other will contain commands Tk4.0 doesn't provide.

commandeth

This program should remain the same, but the default commands might change.
Since text widgets in Tk4.0 now include much more support for extra-long lines,
things like print and mail should really provide for this possibility. (Since
long lines weren't supported well in earlier releases of Tk, these commands
ignored that possibility).

completh

The bindings (Tab, Control-Tab) should probably be changed, since Tab now
switches keyboard focus.

cth

Depending on the bindings that browseth winds up handling, the menubindings for
cth (and errorth, lispth, tclth, and paragrath) may be altered.

edith

Like browseth, many of edith's features are now built-in to Tk4.0, and so edith
will lose some features. However, at least Quote, Case, Indent, and Undo are
unique to edith, so it will continue to provide those.

errorth - No changes, except see under cth.
filebrowseth - no change

fileth

Perhaps super-long lines in text widgets should be split before file I/O is
done. More likely this should not be added to fileth, but rather somewhere else,
like paragrath.

focuth

Despite Tk4.0's addition of keyboard traversal, its focus mechanism differs from
both the class-type and explicit focus mechanisms provided by focuth, and so
focuth is not really obsolete. So focuth will live on, perhaps with modified
keybindings.

gridth

Horizontal grids for text widgets should become scrollable.

Vertical grids for text widgets were manageable in Tk3.6, in Tk4.0, they will be
a nightmare, what with changeable vertical spacing, superlong lines, and
embedded windows. Probably gridth will not change (how can it handle all those
features anyway?), but merely support a HUGE disclaimer that if your text widget
is in any way unusual you'll have weird grids.

The grid sizes depend on the -width and -height options, which are the
*requested* geometry, not the actual size of a widget.

htmlth

See the notes under cth.

I realize this is pretty skimpy for an HTML editor...there are far better ones
out there for Tk. This mode is provided for two reasons -- 1. Raw HTML is still
a useful medium, and 2. A good HTML editor built on top of elsbeth is just in
the making, and this is the quick'n dirty version.

iterath - no change
lispth - see notes under cth, but otherwise, no change
marketh - see notes under cth, but otherwise, no change

paragrath

See notes under cth.

Unlike cth, and the other code browsers (possibly excepting htmlth), super-long
lines will probably be desirable under Tk4.0 for text widgets. So do we want to
support super-long lines, or disdain them? Probably both, in two different
modes. Certainly provide routines to split a single-line paragraph into a
multi-line one, and vice versa.

parenth - See first note under cth, otherwise no changes

resizeth

Widget resizing is different in Tk4.0, due to the geometry overhaul. But
resizeth shouldn't act any differently than before.

searcheth

Tk now handles string and regexps in text searches, so those will be
cmuch cleaner.

taggeth - No new changes
tclth - see notes under cth, otherwise no changes
th - no change
windowth - no change


Code Provided by Hypertools --

Most of the code designed to work on Entries should really be designed to work
on strings. The Entry procedures can then simply call the string procedures with
the argument [$entry get]. (A lot of the code already works this way, but not
all of it.)

complete.*.tcl

The subst facility may be helpful here.

edit.Text.tcl

Since undos use marks, mark gravity should make multiple undos less flaky.

paren.Text.tcl
search.Text.tcl

Tk's text search facility should improve (read: speed up) these modules' performance.


Elsbeth Changes

Despite the extra support for fancy-looking documents, provided by the margins,
spacing, and other configuration features of the text widget and its tags,
Elsbeth will still focus foremost on plain text, while 'fancy' text of various
types (RichText, HTML, etc) will be considered extras.

Perhaps windows in . should have minimal height and be expanded. This would let the user specify a geometry for the toplevel window (.) and all the texts would share .'s space, instead of each one demanding its own space, and somethimes making . inordinately large.

Other Applications:

thterm - May not work unless Expect is compatible with Tk4.0...have to check
into that.

thcolors
thfonts

These don't have to be changed, they just could be useful for configureth. Heck,
we could always do a tkcursors too!


Old Elsbeth To-Do list

- Taggeth should work on canvas items. This is difficult because there is no
easy way to get all the tags used by a canvas

- a hypertool that gives ispell-like capability to widgets.

If you have ideas of other application features, send me mail at:
svoboda@ece.cmu.edu (David Svoboda).


Tk4.0 Default Bindings

Tk4.0 has keyboard binding for most of the features offered by browseth and
edith. Of course, browseth and edith each provide more features than Tk4.0 comes with, so they aren't totally obsolete. Here's a rundown of what Tk4.0 provides for text widgets (then we'll explain about other widgets)

Text widgets already support:

Feature 		Tk4.0   		Elsbeth
-----------		---------		--------
Insert Selection 	Control-v 		Control-y, similar
Char & Word Traversal 	Control/Meta-b/f 	''
Line Traversal 		Control-p/n 	 	''
Paragraph Traversal 	Control-Up/Down 	Control-A/E in Paragraph Mode
Page Traversal 		Next/Prior  		Control/Meta-v
Horizontal Page 	Control-Next/Prior 	Control/Meta-V (when possible)
Line Boundaries  	Control-a/-e 		''
Document Boundaries  	Meta-</> 		''
Mark Setting 		Control-Space 		''
Select Marked Region  	Control-Shift-Space  	Control-W
Select All 		Control-/ 		Meta-W
Select Clear  		Control-\ 		Control-c

Most Tk commands clear the selection. If Shift is held down with a non-QWERTY
key, the selection is extended to the new cursor location, but this doesn't
apply to QWERTY keys, like Control-a. Tk4.0 provides support for the Clipboard,
which is analogous to Elsbeth's kill buffer.

Copy  			Meta-w 			N/A
Cut 			Control-w 		''
Paste 			Control-y 		'' (similar)
Delete Selection  		 		Button-Delete
Delete Char 		Control-h/d 		''
Delete Word 		Meta-d, Control-w (!?) 	Meta-d/h
Delete Line  		Control-k 		N/A
Open Line 		Control-o 		''
Transpose Chars 	Conntrol-t 		'' (similar)

This list is pretty comprehensive (and is likely to become more so in future
releases), and so I feel it is best not to provide independent versions of these
features for text widgets. Therefore browseth and edith only will cover those
functions not provided by Tk4.0. For text widgets those are:

See Line  		 			Control/Meta-Z/z
Goto/See Cursor					Control/Meta-l
Goto Sreen Begin, End 				Meta-,/.
Goto Index					Meta-g

Several commands deserve some individual attention:

Exchange Mark 					Control-x

Control-x already is bound in Tk4.0, so this binding should be changed. It would exchange the cursor with the selection anchor, anyway, and forget about marks.

Transpose Words 				Meta-t

I'm tempted to scrap this feature...it's hard to use, due to the different ways
Tk and people interpret words.

Also, none of the Tk bindings are undoable, so that will be a feature loss, alas. Edith's bindings, however, will. It still can provide:

Case, Quote, Indent, Overwrite, and Undo commands.

Now, since we intend to also support superlong lines in Text widgets, there
should be some commands to traverse them, and maybe select them as well. My
thinking is that Control-N and Control-P will traverse up and down physical
lines (what you see on the screen). Which will act like Control-n and Control-p
already do when lines are short, but when they wrap, Control-N/P will keep the
cursor in (roughly) the same X-location, and just go up and down.

Probably the See line commands (Meta/Control-Z/z) should work on physical lines
instead of logical lines.

We can reimplement Control-K to select physical lines at a time. Some key should
also cut physical lines.

As for non-textual widgets...

Entry widgets provide all the features listed above that don't imply multiple
lines. The single-line features we add for text widgets can also be added to
entry widgets.

Listbox widgets don't use the QWERTY keys, but they have keybindings for all of
the functions described above that can apply to listboxes. Same for scales and
scrollbars. I'm tempted to leave out everything for these widgets except the
Goto command.

Canvas widgets have no bindings (though it sounds like it might change in the
future)  So perhaps we can retain all the current canvas bindings, for now, at
least.

