NAME
history - Provides a history for Entry widgets
SYNOPSIS
package require TTccll 88..44 package require TTkk 88..44 package require hhiissttoorryy ??00..11?? ::::hhiissttoorryy::::iinniitt pathName ?length? ::::hhiissttoorryy::::rreemmoovvee pathName ::::hhiissttoorryy::::aadddd pathName text ::::hhiissttoorryy::::ggeett pathName ::::hhiissttoorryy::::cclleeaarr pathName ::::hhiissttoorryy::::ccoonnffiigguurree pathName option ?value? bellDESCRIPTION
This package provides a convenient history mechanism for Entry widgets. The history may be accessed with the up and down arrow keys. ::::hhiissttoorryy::::iinniitt pathName ?length? Arranges to remember the history of the named Entry widget. An optional length determines the number of history entries tokeep. This may be changed later with ::::hhiissttoorryy::::ccoonnffiigguurree. His-
tory entries must be added with the ::::hhiissttoorryy::::aadddd command before they can be seen. ::::hhiissttoorryy::::rreemmoovvee pathName Forgets all history entries for the Entry pathName and removes the history bindings. ::::hhiissttoorryy::::aadddd pathName text This command is used to add history entries to an Entry that has previously had ::::hhiissttoorryy::::iinniitt 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). ::::hhiissttoorryy::::ggeett pathName This command returns a list containing the history entries for the Entry pathName ::::hhiissttoorryy::::cclleeaarr pathName This command clears the history list for the named Entry. ::::hhiissttoorryy::::ccoonnffiigguurree pathName option ?value? This command queries or sets configuration options. Currently the options recognized are length and 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 bell entry .ebind .e
::history::init .e pack .e proc ProcessEntry {w} {[list ProcessEntry %W] set text [$w get]
if {$text == ""} { return }
::history::add $w $text
puts $text
$w delete 0 end
} KKEEYYWWOORRDDSS entry, history history 0.1 history(n)