summaryrefslogtreecommitdiffstats
path: root/library/demos/text.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'library/demos/text.tcl')
-rw-r--r--library/demos/text.tcl16
1 files changed, 8 insertions, 8 deletions
diff --git a/library/demos/text.tcl b/library/demos/text.tcl
index 52d6030..21ee096 100644
--- a/library/demos/text.tcl
+++ b/library/demos/text.tcl
@@ -7,6 +7,8 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
+package require Tk
+
set w .text
catch {destroy $w}
toplevel $w
@@ -14,15 +16,13 @@ wm title $w "Text Demonstration - Basic Facilities"
wm iconname $w "text"
positionWindow $w
-frame $w.buttons
-pack $w.buttons -side bottom -fill x -pady 2m
-button $w.buttons.dismiss -text Dismiss -command "destroy $w"
-button $w.buttons.code -text "See Code" -command "showCode $w"
-pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
+## See Code / Dismiss buttons
+set btns [addSeeDismiss $w.buttons $w]
+pack $btns -side bottom -fill x
-text $w.text -relief sunken -bd 2 -yscrollcommand "$w.scroll set" -setgrid 1 \
+text $w.text -yscrollcommand [list $w.scroll set] -setgrid 1 \
-height 30 -undo 1 -autosep 1
-scrollbar $w.scroll -command "$w.text yview"
+scrollbar $w.scroll -command [list $w.text yview]
pack $w.scroll -side right -fill y
pack $w.text -expand yes -fill both
$w.text insert 0.0 \
@@ -68,7 +68,7 @@ insertion cursor. Control-z undoes the last editing action performed,
and }
switch $tcl_platform(platform) {
- "unix" - "macintosh" {
+ "unix" {
$w.text insert end "Control-Shift-z"
}
"windows" {