summaryrefslogtreecommitdiffstats
path: root/library/demos/ctext.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'library/demos/ctext.tcl')
-rw-r--r--library/demos/ctext.tcl12
1 files changed, 6 insertions, 6 deletions
diff --git a/library/demos/ctext.tcl b/library/demos/ctext.tcl
index 3be4b58..e894bc2 100644
--- a/library/demos/ctext.tcl
+++ b/library/demos/ctext.tcl
@@ -7,6 +7,8 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
+package require Tk
+
set w .ctext
catch {destroy $w}
toplevel $w
@@ -25,11 +27,9 @@ label $w.msg -font $font -wraplength 5i -justify left -text "This window display
the character just after the insertion cursor."
pack $w.msg -side top
-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
canvas $c -relief flat -borderwidth 0 -width 500 -height 350
pack $w.c -side top -expand yes -fill both
@@ -40,7 +40,7 @@ $c create rectangle 245 195 255 205 -outline black -fill red
# First, create the text item and give it bindings so it can be edited.
-$c addtag text withtag [$c create text 250 200 -text "This is just a string of text to demonstrate the text facilities of canvas widgets. Bindings have been been defined to support editing (see above)." -width 440 -anchor n -font {Helvetica 24} -justify left]
+$c addtag text withtag [$c create text 250 200 -text "This is just a string of text to demonstrate the text facilities of canvas widgets. Bindings have been been defined to support editing (see above)." -width 440 -anchor n -font $textFont -justify left]
$c bind text <1> "textB1Press $c %x %y"
$c bind text <B1-Motion> "textB1Move $c %x %y"
$c bind text <Shift-1> "$c select adjust current @%x,%y"