# bind.tcl --
#
# This demonstration script creates a text widget with bindings set
# up for hypertext-like effects.
#
# SCCS: @(#) bind.tcl 1.5 96/04/12 11:48:26
set w .bind
catch {destroy $w}
toplevel $w
# Set up display styles.
set bold "-background #43ce80 -relief raised -borderwidth 1"
set normal "-background {} -relief flat"
} else {
set bold "-foreground white -background black"
set normal "-foreground {} -background {}"
}
# Add text to widget.
The same tag mechanism that controls display styles in text widgets can also be used to associate Tcl commands with regions of text, so that mouse or keyboard actions on the text cause particular Tcl commands to be invoked. For example, in the text below the descriptions of the canvas demonstrations have been tagged. When you move the mouse over a demo description the description lights up, and when you press button 1 over a description then that particular demonstration is invoked.
}
# Create bindings for tags.
}