Description text
This command adds dynamic help to the given widget.
Creating dynamic help for a menu is a two-step process. The menu itself must first be added and then each menu entry must be added separately. Here is a brief example.
# create menu menu .m -type menubar # associate menubar to toplevel BEFORE DynamicHelp::register # to make it works with menu clone name . configure -menu .m .m add cascade -label "File" -menu .m.file menu .m.file .m.file add command -label "Open..." .m.file add command -label "Quit" # create label for help, using variable varinfo label .l -textvariable varinfo # associate all entries of menu .m.file to variable varinfo DynamicHelp::add .m.file -type menu -variable varinfo # then declare entries of .m.file DynamicHelp::add .m.file -type menu -index 0 -text "Detach menu" DynamicHelp::add .m.file -type menu -index 1 -text "Open a file" DynamicHelp::add .m.file -type menu -index 2 -text "Exit demo" |
-background or -bg | -font |
-foreground or -fg | -justify |
-padx | -pady |
Its use is deprecated. Use DynamicHelp::add instead.
Register a help text to the widget path. type determines the type of the help or the type of the widget. Depending on type, other options must be provided.type | options |
balloon | ?tagOrItem? text |
variable | ?tagOrItem? varName text |
menu | varName |
menuentry | index text |
If tagOrItem is specified, then path is a canvas, and tagOrItem is the name of a tag or item on the canvas to which the help will be bound.
For type other than balloon, varName is typically a variable linked to a label.# create menu menu .m -type menubar # associate menubar to toplevel BEFORE DynamicHelp::register # to make it works with menu clone name . configure -menu .m .m add cascade -label "File" -menu .m.file menu .m.file .m.file add command -label "Open..." .m.file add command -label "Quit" # create label for help, using variable varinfo label .l -textvariable varinfo # associate all entries of menu .m.file to variable varinfo DynamicHelp::register .m.file menu varinfo # then declare entries of .m.file DynamicHelp::register .m.file menuentry 0 "Detach menu" DynamicHelp::register .m.file menuentry 1 "Open a file" DynamicHelp::register .m.file menuentry 2 "Exit demo" |