{jmore.tcl
Introduction
The jmore.tcl library provides procedures for displaying (potentially long) text, such as the contents of a file or the output of a command.  (For short notices, j:alert from the jalert.tcl library may be more appropriate.)

The jmore.tcl library is distributed as part of the jstools package.

This document describes jmore.tcl version 2001.02.10.
Usage
Accessing the Library
In order to use the jmore.tcl library, it (and any other libraries it depends on) must be in your Tcl auto_path, described in tclvars(n).  Information about how to arrange that, and other conventions common to the jstools libraries, is in the Usage section of The jstools Libraries.
Credits and Copyright
Author
Jay Sekora 
js@aq.org
http://www.aq.org/~js/
Copyright
The library is copyright © 1992-2001 by Jay Sekora, but may be freely redistributed under the conditions at the top of the file.
Overview
Procedures
::jstools::more - display text in window
::jstools::more
Usage
	::jstools::more [options]
Options
	-title title  (default {})
	-text text  (default {} - not really optional)
	-annotation annotation  (default {})
	-height h  (default 24)
	-width w  (default 80)
	-wrap wrap  (default `char')
	-font font  (default `default')
	-class class  (default `More')
Example
	set helpFile [open "help.doc"]
	::jstools::more -title "Application Help" -text [read $helpFile]
	close $helpFile
Note
In prior versions of jstools, the argument to the -text option was automatically localized.  In the current version it is not.
Description
This procedure creates a new non­modal toplevel window with a text widget containing text, a scrollbar, and a set of buttons.  The toplevel will have the title title, and the window class class, which can be used for specifying X resources or window­manager behaviour.  The text widget will be h lines tall and w characters wide, and its contents will be displayed in the font font.  (If font is `default', then the X Windows default font for the ::jstools::more text widget will be used.)  Its lines will be wrapped according to wrap, which can be line, char, or none.

If annotation is specified (and is non­null), it is annotation (tags and marks) to be applied to text, in the format implemented by the jtexttags.tcl library and created by jedit's richtext mode, and it will be displayed with appropriate formatting.  (Note that you may want wrap to be word in this case.)

The text widget will be disabled, so the user can't alter its contents.

Pressing Space, Next or PageDown, or Control-v will scroll the text down, and pressing b, Prior or PageUp, or Escape-v will scroll the text up.

Four buttons will appear at the bottom of the window, labelled `Find...', `Print', `Save', and `Close'.

Close
`Close' is the default button (i.e., Return will invoke it), and it destroys the window.

Save
`Save' lets the user save the contents of the window into a file.

Print
`Print' displays a confirmation panel, and, if the user clicks OK, prints the contents of the ::jstools::more window to the printer named by the global variable J_PREFS(printer) (or lp if J_PREFS(printer) is not set), using the lpr command.

Find...
`Find...' brings up a Find panel that lets you search for a string in the text.

The ::jstools::more procedure returns the pathname of the text widget, in case the caller wants to further configure it or manipulate its contents.
Bugs and Limitations
· The term more isn't likely to be intuitive to non-Unix users.
Future Directions
· There should be a way to specify which buttons you want on a ::jstools::more panel, and to add application­specific buttons.
· There should be independent global preferences for the size, font, and colour of ::jstools::more text widgets.
· Interaction with the find panel should be made more intuitive.
There needs to be error checking in ::jstools::more:print and ::jstools::more:save.
} {{{list:level:1 {64.0 65.0 66.0 70.0}} {jdoc:anchor:anchorname {2.0 3.0 8.0 9.0 11.0 12.0 18.0 19.0 21.0 22.0}} {jdoc:xref:link {3.162 3.169 3.179 3.189 5.52 5.59 10.210 10.231 10.239 10.256 10.260 10.281 20.0 20.15 21.0 22.0 42.136 42.149 42.173 42.178 42.181 42.194 60.22 60.32}} {jdoc:xref:manpage {10.126 10.133}} {richtext:font:roman {3.0 3.4 3.13 3.162 3.169 3.179 3.189 5.4 5.13 5.52 5.59 7.24 7.33 8.0 9.21 10.20 10.29 10.102 10.111 10.126 10.133 10.214 10.221 10.243 10.248 10.260 10.281 10.282 13.0 14.0 14.9 15.0 15.22 16.0 17.0 18.0 20.15 21.0 23.17 23.18 23.25 24.0 25.15 25.24 25.26 26.0 26.13 26.22 26.24 27.0 27.25 27.34 27.36 28.0 28.12 28.21 28.23 29.0 29.11 29.20 29.22 30.0 30.13 30.23 30.27 31.0 31.13 31.23 31.30 32.0 32.15 32.25 32.29 33.0 38.0 38.21 38.28 38.50 38.55 39.0 40.0 40.85 40.89 40.160 40.165 40.188 40.193 40.294 40.295 40.311 40.312 40.377 40.381 40.397 40.404 40.447 40.462 40.530 40.534 40.549 40.553 40.555 40.559 40.564 40.568 42.3 42.13 42.97 42.101 42.136 42.149 42.173 42.178 42.181 42.189 42.275 42.279 42.286 42.290 46.9 46.14 46.16 46.20 46.24 46.32 46.37 46.46 46.87 46.88 46.90 46.95 46.99 46.105 46.110 46.118 50.0 51.0 51.37 51.43 53.0 54.0 56.0 57.0 57.94 57.109 57.161 57.177 57.182 57.184 57.188 57.204 57.228 57.231 59.0 60.0 62.4 62.19 63.0 64.0 64.11 64.15 65.0 66.0 66.63 66.78 67.83 67.98 69.36 69.57 69.62 69.82 70.0}} {richtext:font:italic {23.18 23.25 25.8 25.13 26.7 26.11 27.13 27.23 28.9 28.10 29.8 29.9 30.7 30.11 31.7 31.11 32.8 32.13 40.85 40.89 40.160 40.165 40.188 40.193 40.294 40.295 40.311 40.312 40.377 40.381 40.530 40.534 42.3 42.13 42.97 42.101 42.275 42.279}} {richtext:font:bold {3.4 3.13 3.179 3.189 5.4 5.13 5.52 5.59 7.24 7.33 10.20 10.29 10.214 10.221 38.21 38.28 42.136 42.149 46.9 46.14 46.16 46.20 46.24 46.32 46.37 46.46 46.87 46.88 46.90 46.95 46.99 46.105 46.110 46.118 51.37 51.43}} {richtext:font:bolditalic {10.243 10.248 10.260 10.281}} {richtext:font:typewriter {3.162 3.169 10.102 10.111 10.126 10.133 14.0 14.9 15.0 15.22 20.0 20.15 23.0 23.17 25.0 25.8 25.13 25.15 25.24 25.26 26.0 26.7 26.11 26.13 26.22 26.24 27.0 27.13 27.23 27.25 27.34 27.36 28.0 28.9 28.10 28.12 28.21 28.23 29.0 29.8 29.9 29.11 29.20 29.22 30.0 30.7 30.11 30.13 30.23 30.27 31.0 31.7 31.11 31.13 31.23 31.30 32.0 32.8 32.13 32.15 32.25 32.29 34.0 37.0 38.50 38.55 40.397 40.404 40.447 40.462 40.549 40.553 40.555 40.559 40.564 40.568 42.173 42.178 42.181 42.189 42.286 42.290 57.94 57.109 57.161 57.177 57.182 57.184 57.188 57.204 57.228 57.231 62.4 62.19 64.11 64.15 66.63 66.78 67.83 67.98 69.36 69.57 69.62 69.82}} {richtext:font:heading0 {1.0 2.0}} {richtext:font:heading1 {2.0 3.0 8.0 9.0 11.0 12.0 18.0 19.0 21.0 22.0 63.0 64.0 65.0 66.0}} {richtext:font:heading2 {9.0 9.21 10.282 11.0 12.0 13.0 16.0 17.0 19.0 20.0 22.0 23.0 24.0 25.0 33.0 34.0 37.0 38.0 39.0 40.0}} {richtext:font:heading3 {50.0 51.0 53.0 54.0 56.0 57.0 59.0 60.0}} {{} {10.243 10.256 11.0 17.0 18.0 20.0 21.0 26.47 27.37 33.0 40.0 41.0 43.0 50.0 51.1 51.6 51.7 53.0 54.1 54.5 54.6 56.0 57.1 57.6 57.7 59.0 60.1 60.8 60.9 63.0}} {jdoc:link:jstools.jdoc {5.52 5.59}} {jdoc:manpage:tclvars {10.126 10.133}} {jdoc:link:jslibraries.jdoc#Usage {10.239 10.256}} {jdoc:link:jslibraries.jdoc {10.260 10.281}} {jdoc:anchorname:Credits_and_Copyright {11.0 12.0}} {jdoc:anchorname:Introduction {2.0 3.0}} {jdoc:anchorname:Usage {8.0 9.0}} {jdoc:link:jslibraries.tcl {10.210 10.231}} {jdoc:anchorname:Overview {18.0 19.0}} {jdoc:link:jalert.tcl.jdoc#j:alert {3.162 3.169}} {jdoc:link:jalert.tcl.jdoc {3.179 3.189}} {jdoc:anchorname:j:more {21.0 22.0}} {jdoc:link:jtexttags.tcl.jdoc {42.136 42.149}} {jdoc:link:jedit.jdoc {42.173 42.178}} {jdoc:link:jeditmodes/richtext-mode.jdoc {42.181 42.194}} {list:1:ul {64.0 65.0 66.0 70.0}} {jdoc:link:#::jstools::more {20.0 20.15 21.0 22.0}} {jdoc:link:findpanel.html {60.22 60.32}} {special:list_item:1 {64.0 64.1 66.0 66.1 67.0 67.1 68.0 68.1}}} {{abbrevstart 7.50} {del_from 70.0} {emacs_mark 70.0} {anchor 38.88} {matchstart 70.0} {insert_save 64.63} {richptr 11.0} {insert 38.88} {del_to 70.0} {abbrevend 7.53} {current 1.0} {matchend 70.0}}} {{body_alink #ff0000} {body_vlink #000080} {body_link #0000ff} {body_text #000000} {body_bgcolor #ffffff}}