Not balloon help

Purpose: Embed context sensitive help into a Tcl/Tk application
See also: balloon help
Credits: DKFs answer to a respective question on stack overflow.
Pros: As simple as can be, no external dependencies, no clutter, less distraction
Cons: Always needs space on the GUI, less obvious help for unexperienced users.

LEG Instead of popping up an extra window for tooltip help:

  • Reserve some space on your GUI for displaying the respective help text. This can be a status line on the bottom of the window.
  • Update this help text with the <Enter>/<Leave> events of the respective widgets.

Example code:

# a global variable, you might want to put this in a namespace
set help "Hover over any widget to get help for it"

proc help {widget text} {
    # register help text with widget

    bind $widget <Enter> +[list set ::help $text]
    bind $widget <Leave> +[list set ::help ""]

# create the help text widget somewhere on your applications top level
# window or in some frame $w

label $ -textvariable help -anchor nw -justify left

# register help for the help window itself
help $ "Hover over any widget to get help for it"

% in text gets substituted according to bind rules. Use %% to get a simple percent sign.

Variable substitution in text is done in the moment the help text is registered. See Bindings and variable substitution for hints how to change this.