Tk Library Source Code

Documentation
Login


[ Main Table Of Contents | Table Of Contents | Keyword Index | Categories | Modules | Applications ]

NAME

ntext - Alternative Bindings for the Text Widget

Table Of Contents

SYNOPSIS

package require Tcl 8.5-
package require Tk 8.5-
package require ntext ?1.0?

::ntext::new_textCopy pathName
::ntext::new_textCut pathName
::ntext::new_textPaste pathName
::ntext::syncIndentColor pathName
::ntext::syncTabColor pathName

DESCRIPTION

The purpose of the ntext package is to make the text widget behave more like other text-editing applications. It makes the text widget more useful for implementing a text editor, and makes it behave in a way that will be more familiar to most users.

The package provides a binding tag named Ntext for use by text widgets in place of the default Text binding tag.

Package ntext 's functions and variables are contained entirely in the ::ntext namespace; its other code is contained in the binding tag Ntext. ntext has no exports to the global or other namespaces, and no new widget commands. It uses modified copies of the Tk code, leaving the original code, and the Text binding tag, unchanged.

The differences between the Ntext binding tag and the default Text binding tag are in three categories:

The remainder of this page describes the basic use and configuration of all three aspects of Ntext. For more detailed information on the different facilities of Ntext, see the pages ntextBindings, ntextIndent, and ntextWordBreak.

See Section EXAMPLE for how to apply the Ntext binding tag in place of the Text binding tag.

COMMANDS

CONFIGURATION OPTIONS

Ntext provides alternatives to a number of behaviours of the classic Text binding tag. Where there is an option, the Ntext behaviour (except for display-line indentation) is switched on by default.

The behaviour of Ntext may be configured application-wide by setting the values of a number of namespace variables:

::ntext::classicAnchor

::ntext::classicExtras

::ntext::classicMouseSelect

::ntext::classicParagraphs

::ntext::classicSelection

::ntext::classicWordBreak

::ntext::classicWrap

::ntext::indentColor

::ntext::overwrite

::ntext::tabColor

::ntext::tabSelColor

::ntext::useBlockCursor

BUGS

This version of ntext is intended to be compatible with all releases of Tk 8.5, 8.6, and 8.7, and with the branches core-8-5-branch, core-8-6-branch, and trunk in the source code repository for Tk. Any incompatibility with any of these versions, for any Tk windowing system, should be reported as a bug. Please report such in the category ntext of the Tklib Trackers.

EXAMPLE

To create a text widget .t and use the Ntext bindings:

package require ntext
text .t
bindtags .t {.t Ntext . all}

See bindtags for more information.

SEE ALSO

bindtags, ntextBindings, ntextIndent, ntextWordBreak, re_syntax, regexp, text

KEYWORDS

bindtags, re_syntax, regexp, text