File: tklib_history.man

package info (click to toggle)
tklib 0.8~20230222-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 20,904 kB
  • sloc: tcl: 97,356; sh: 5,823; ansic: 792; pascal: 359; makefile: 70; sed: 53; exp: 21
file content (70 lines) | stat: -rw-r--r-- 2,318 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
[comment {-*- tcl -*- doctools manpage}]
[manpage_begin history n 0.1]
[keywords entry]
[keywords history]
[moddesc   {Provides a history for Entry widgets}]
[titledesc {Provides a history for Entry widgets}]
[require Tcl 8.4]
[require Tk 8.4]
[require history [opt 0.1]]
[description]

This package provides a convenient history mechanism for Entry widgets.
The history may be accessed with the up and down arrow keys.

[para]

[list_begin definitions]

[call [cmd ::history::init] [arg pathName] [opt length]]

Arranges to remember the history of the named Entry widget. An optional length
determines the number of history entries to keep. This may be changed later
with [cmd ::history::configure]. History entries must be added with the
[cmd ::history::add] command before they can be seen.

[call [cmd ::history::remove] [arg pathName]]

Forgets all history entries for the Entry [arg pathName] and removes the history
bindings.

[call [cmd ::history::add] [arg pathName] [arg text]]

This command is used to add history entries to an Entry that has previously had
[cmd ::history::init] called on it. This command should be called from your Entry
handler with the contents of the entry (or whatever you wish to add to the history).

[call [cmd ::history::get] [arg pathName]]

This command returns a list containing the history entries for the Entry [arg pathName]

[call [cmd ::history::clear] [arg pathName]]

This command clears the history list for the named Entry.

[call [cmd ::history::configure] [arg pathName] [arg option] [opt value]]

This command queries or sets configuration options. Currently the options recognized
are [arg length] and [arg alert]. Setting the length determines the number of history entries to keep for
the named Entry. Alert specifies the command to run when the user reaches the end of the history, it defaults to [cmd bell]. Although configure requires a [arg pathName] argument, the setting for alert is global and the path is ignored.

[list_end]

[example {
entry .e
bind .e <Return> [list ProcessEntry %W]
::history::init .e
pack .e

proc ProcessEntry {w} {
    set text [$w get]
    if {$text == ""} { return }
    ::history::add $w $text
    puts $text
    $w delete 0 end
}

}]
[vset CATEGORY entry::history]
[include ../../support/devel/doc/feedback.inc]
[manpage_end]