You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The purpose of the \fBntext\fR 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\&.
291
293
.PP
292
294
The package provides a binding tag named \fINtext\fR for use by text widgets in place of the default \fIText\fR binding tag\&.
293
295
.PP
294
-
Package \fBntext\fR 's functions and variables are contained entirely in the \fB::ntext\fR namespace; its other code is contained in the binding tag \fINtext\fR\&. \fBntext\fR 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 \fIText\fR binding tag, unchanged\&.
296
+
Package \fBntext\fR 's functions and variables are contained entirely in the \fB::ntext\fR namespace; its other code is contained in the binding tag \fINtext\fR\&. \fBntext\fR has no exports to the global or other namespaces, and no new widget commands\&. It uses modified copies of the \fBTk\fR code, leaving the original code, and the \fIText\fR binding tag, unchanged\&.
295
297
.PP
296
298
The differences between the \fINtext\fR binding tag and the default \fIText\fR binding tag are in three categories:
297
299
.IP\(bu
298
300
Some \fIText\fR bindings behave differently from most text-editing applications\&. \fINtext\fR gives these bindings more familiar behaviour\&. For details see \fIntextBindings\fR\&.
299
301
.IP\(bu
300
302
When a logical line with leading whitespace is word-wrapped onto more than one display line, the wrapped display lines begin further to the left than the first display line, which can make the text layout untidy and difficult to read\&. \fINtext\fR can indent the wrapped lines to match the leading whitespace of the first display line (this facility is switched off by default)\&. For details see \fIntextIndent\fR\&.
301
303
.IP\(bu
302
-
When the user navigates or selects text, Tcl/Tk sometimes needs to detect word boundaries\&. \fINtext\fR provides improved rules for word boundary detection\&. For details see \fIntextWordBreak\fR\&.
304
+
When the user navigates or selects text, \fBTcl/Tk\fR sometimes needs to detect word boundaries\&. \fINtext\fR provides improved rules for word boundary detection\&. For details see \fIntextWordBreak\fR\&.
303
305
.PP
304
306
The remainder of this page describes the basic use and configuration of all three aspects of \fINtext\fR\&. For more detailed information on the different facilities of \fINtext\fR, see the pages \fIntextBindings\fR, \fIntextIndent\fR, and \fIntextWordBreak\fR\&.
305
307
.PP
@@ -314,6 +316,9 @@ Replacement for ::tk_textCut that also maintains \fINtext\fR indentation (see \f
314
316
.TP
315
317
\fB::ntext::new_textPaste\fR\fIpathName\fR
316
318
Replacement for ::tk_textPaste that also maintains \fINtext\fR indentation (see \fIntextIndent\fR)\&.
319
+
.TP
320
+
\fB::ntext::syncIndentColor\fR\fIpathName\fR
321
+
Command to apply the current value of the variable \fB::ntext::indentColor\fR to existing lines in a text widget\&. This command is useful if a text widget has been created, text has been inserted in the widget, \fIandthen\fR the value of \fB::ntext::indentColor\fR is changed (see \fIntextIndent\fR)\&.
317
322
.PP
318
323
.SH "CONFIGURATION OPTIONS"
319
324
\fINtext\fR provides alternatives to a number of behaviours of the classic \fIText\fR binding tag\&. Where there is an option, the \fINtext\fR behaviour (except for display-line indentation) is switched on by default\&.
@@ -347,6 +352,15 @@ For more information see \fIntextBindings\fR
347
352
For more information see \fIntextBindings\fR
348
353
.PP
349
354
.PP
355
+
\fB::ntext::classicParagraphs\fR
356
+
.IP\(bu
357
+
\fB0\fR - (default value) on macOS Aqua, certain keyboard bindings are made to behave in the same way as the Mac application TextEdit\&. The bindings involve vertical scrolling of the screen and are <?Shift-?Option-(Up|Down)>\&.
358
+
.IP\(bu
359
+
\fB1\fR - on macOS Aqua, certain keyboard bindings are made to behave in the same way as classic \fIText\fR, ignoring the conventions of Aqua\&. The bindings involve vertical scrolling of the screen and are <?Shift-?Option-(Up|Down)>\&.
360
+
.IP\(bu
361
+
For more information see \fIntextBindings\fR
362
+
.PP
363
+
.PP
350
364
\fB::ntext::classicSelection\fR
351
365
.IP\(bu
352
366
\fB0\fR - (default value on macOS Aqua) selects Mac-like behaviour, i\&.e\&. when a navigation keystroke cancels a selection, the insert mark first moves to the end of the selection determined by the navigation direction of the keystroke, and then the keystroke is applied\&.
@@ -374,6 +388,19 @@ After changing this value, the matching patterns should be recalculated\&. See
374
388
For more information see \fIntextIndent\fR
375
389
.PP
376
390
.PP
391
+
\fB::ntext::indentColor\fR
392
+
.IP\(bu
393
+
\fB{}\fR - if the value is the empty string, then the indent of wrapped display lines has the same color as the widget background\&.
394
+
.IP\(bu
395
+
\fIcolor\fR - a valid \fBTk\fR color to use for the indent of wrapped display lines (default value \fI#d9d9d9\fR)\&.
396
+
.sp
397
+
Coloring is implemented with the text widget tag option \fI-lmargincolor\fR, which is available from \fBTk\fR 8\&.6\&.6 onwards\&. \fINtext\fR indent coloring has no effect in earlier versions of \fBTk\fR\&.
398
+
.sp
399
+
The value of \fB::ntext::indentColor\fR will often be set at startup\&. If the value is changed when text widgets already exist and contain text, those widgets can be updated by calling command \fB::ntext::syncIndentColor\fR\&.
400
+
.IP\(bu
401
+
For more information see \fIntextIndent\fR
402
+
.PP
403
+
.PP
377
404
\fB::ntext::overwrite\fR
378
405
.IP\(bu
379
406
\fB0\fR - (initial value) text typed at the keyboard is inserted into the widget
@@ -385,11 +412,13 @@ The value is toggled by the \fIInsert\fR key (except on macOS Aqua where there i
385
412
For more information see \fIntextBindings\fR
386
413
.PP
387
414
.PP
388
-
\fB::ntext::classicParagraphs\fR
415
+
\fB::ntext::useBlockCursor\fR
389
416
.IP\(bu
390
-
\fB0\fR - (default value) on macOS Aqua, certain keyboard bindings are made to behave in the same way as the Mac application TextEdit\&. The bindings involve vertical scrolling of the screen and are <?Shift-?Option-(Up|Down)>\&.
417
+
\fB0\fR - the block cursor will not be used\&. When the widget is in \fIoverwrite\fR mode (see \fB::ntext::overwrite\fR), the ordinary cursor will change color instead\&.
391
418
.IP\(bu
392
-
\fB1\fR - on macOS Aqua, certain keyboard bindings are made to behave in the same way as classic \fIText\fR, ignoring the conventions of Aqua\&. The bindings involve vertical scrolling of the screen and are <?Shift-?Option-(Up|Down)>\&.
419
+
\fB1\fR - the block cursor will be used when the widget is in \fIoverwrite\fR mode (see \fB::ntext::overwrite\fR)\&.
420
+
.IP\(bu
421
+
The default value depends on the version of \fBTk\fR\&. In versions of \fBTk\fR earlier than \fB8\&.5\&.12\fR, the sizing of the block cursor had a bug, and \fB::ntext::useBlockCursor\fR defaults to \fB0\fR\&. From \fB8\&.5\&.12\fR onwards the bug is fixed, and \fB::ntext::useBlockCursor\fR defaults to \fB1\fR\&.
393
422
.IP\(bu
394
423
For more information see \fIntextBindings\fR
395
424
.PP
@@ -409,4 +438,4 @@ See bindtags for more information\&.
409
438
.SH "SEE ALSO"
410
439
bindtags, ntextBindings, ntextIndent, ntextWordBreak, re_syntax, regexp, text
Copy file name to clipboardExpand all lines: embedded/man/files/modules/ntext/ntextBindings.n
+13-4
Original file line number
Diff line number
Diff line change
@@ -343,6 +343,13 @@ The behaviour of \fINtext\fR may be configured application-wide by setting the v
343
343
\fB1\fR - selects classic \fIText\fR behaviour
344
344
.PP
345
345
.PP
346
+
\fB::ntext::classicParagraphs\fR
347
+
.IP\(bu
348
+
\fB0\fR - (default value) on macOS Aqua, certain keyboard bindings are made to behave in the same way as the Mac application TextEdit\&. The bindings involve vertical scrolling of the screen and are <?Shift-?Option-(Up|Down)>\&.
349
+
.IP\(bu
350
+
\fB1\fR - on macOS Aqua, certain keyboard bindings are made to behave in the same way as for the Windows and X11 windowing systems and the classic \fIText\fR, ignoring the conventions of Aqua\&. The bindings involve vertical scrolling of the screen and are <?Shift-?Option-(Up|Down)>\&.
351
+
.PP
352
+
.PP
346
353
\fB::ntext::classicSelection\fR
347
354
.IP\(bu
348
355
\fB0\fR - (default value on macOS Aqua) selects Mac-like behaviour, i\&.e\&. when a navigation keystroke cancels a selection, the insert mark first moves to the end of the selection determined by the navigation direction of the keystroke, and then the keystroke is applied\&.
@@ -359,11 +366,13 @@ The behaviour of \fINtext\fR may be configured application-wide by setting the v
359
366
The value is toggled by the \fIInsert\fR key\&.
360
367
.PP
361
368
.PP
362
-
\fB::ntext::classicParagraphs\fR
369
+
\fB::ntext::useBlockCursor\fR
363
370
.IP\(bu
364
-
\fB0\fR - (default value) on macOS Aqua, certain keyboard bindings are made to behave in the same way as the Mac application TextEdit\&. The bindings involve vertical scrolling of the screen and are <?Shift-?Option-(Up|Down)>\&.
371
+
\fB0\fR - the block cursor will not be used\&. When the widget is in \fIoverwrite\fR mode (see \fB::ntext::overwrite\fR), the ordinary cursor will change color instead\&.
365
372
.IP\(bu
366
-
\fB1\fR - on macOS Aqua, certain keyboard bindings are made to behave in the same way as for the Windows and X11 windowing systems and the classic \fIText\fR, ignoring the conventions of Aqua\&. The bindings involve vertical scrolling of the screen and are <?Shift-?Option-(Up|Down)>\&.
373
+
\fB1\fR - the block cursor will be used when the widget is in \fIoverwrite\fR mode (see \fB::ntext::overwrite\fR)\&.
374
+
.IP\(bu
375
+
The default value depends on the version of \fBTk\fR\&. In versions of \fBTk\fR earlier than \fB8\&.5\&.12\fR, the sizing of the block cursor had a bug, and \fB::ntext::useBlockCursor\fR defaults to \fB0\fR\&. From \fB8\&.5\&.12\fR onwards the bug is fixed, and \fB::ntext::useBlockCursor\fR defaults to \fB1\fR\&.
367
376
.PP
368
377
.SH INTERNALS
369
378
In order to remain independent of the version of \fBTk\fR (8\&.5 or 8\&.6), \fBntext\fR defines its own virtual events\&. These new virtual events are used only in the \fINtext\fR binding tag, and therefore do not interfere with the real or virtual events used in other code\&.
0 commit comments