#
# This demonstration script creates a text widget with a bunch of
# embedded windows.
#
wm title $
w "Text Demonstration - Embedded Windows"
button $
t.
on -
text "Turn On" -
command "textWindOn $w" \
button $
t.
off -
text "Turn Off" -
command "textWindOff $w" \
$
t insert end "A text widget can contain other widgets embedded "$
t insert end "it. These are called \"embedded windows\", "$
t insert end "and they can consist of arbitrary widgets. "$
t insert end "For example, here are two embedded button "$
t insert end "widgets. You can click on the first button to "$
t insert end " horizontal scrolling, which also turns off "$
t insert end "word wrapping. Or, you can click on the second "$
t insert end " horizontal scrolling and turn back on word wrapping.\n\n"
$
t insert end "Or, here is another example. If you "$
t insert end " a canvas displaying an x-y plot will appear right here."$
t insert end " You can drag the data points around with the mouse, "
$
t insert end "You may also find it useful to put embedded windows in "$
t insert end "a text without any actual text. In this case the "$
t insert end "text widget acts like a geometry manager. For "$
t insert end "example, here is a collection of buttons laid out "$
t insert end "neatly into rows by the text widget. These buttons "$
t insert end "can be used to change the background color of the "$
t insert end "text widget (\"Default\" restores the color to "$
t insert end "its default). If you click on the button labeled "$
t insert end "\"Short\", it changes to a longer string so that "$
t insert end "you can see how the text widget automatically "$
t insert end "changes the layout. Click on the button again "
"$t configure -bg $color"
}
}
}
return
}
for {
set i 0} {$
i <
= 10} {
incr i} {
}
for {
set i 0} {$
i <
= 5} {
incr i} {
}
}
$
c bind point <
1>
"embPlotDown $c %x %y" }
}
}
}
}
}
}
}