#!/afs/ece/usr/tcl/bin/wish -f
# The next line is executed by most shells, but not Tcl \
wish $0 $*


set Bind_Keyword [file tail [info script]]
source "[file dirname [info script]]/../util/frame.tcl"

# Help text.
set Help "" ; append Help {Keyhistoryth -- teach an entry widget how to traverse its history stack

This program teaches entry widgets how to manage and traverse a history stack.
(It's conceptually similar to history stacks of most shells). It uses the same
history list used by historyth, you can use both on the same widget.

} $TH_Bindings_Help {
Widgets of Keyhistoryth

History Limit entry

This merely sets a limit on how long the history menu can become. If -1 is given
as a value, no limit is used.
} $TH_Frame_Help


# Gives app all the code necessary to do our functions.
proc teach_code {} {
  global Class TH_Dir Widget History_Limit
  include_files {history.tcl th_history_menu}
  do_cmd_set TH(History,Limit,$Widget) $History_Limit
}

# For a widget, returns the appropriate bindings. (They will depend on the
# widget)
proc widget_bindings {} {
  global Bindings Class
  if {$Class == "Entry"} {return $Bindings(Keyhistory)}
}

create_form_entry .limit "History Limit" History_Limit -1
