summaryrefslogtreecommitdiffstats
path: root/tk8.6/library/demos/textpeer.tcl
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2019-04-22 15:46:20 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2019-04-22 15:46:20 (GMT)
commit7e8909a08b8e425eeaa69085cbe86e848f2f5650 (patch)
treef26e5e21fe28674bab321d6453ea32b5a4a491e2 /tk8.6/library/demos/textpeer.tcl
parent346eeb31d1c0a2ee959ecfade3cd66e3dc07cf4b (diff)
downloadblt-7e8909a08b8e425eeaa69085cbe86e848f2f5650.zip
blt-7e8909a08b8e425eeaa69085cbe86e848f2f5650.tar.gz
blt-7e8909a08b8e425eeaa69085cbe86e848f2f5650.tar.bz2
backout tcl/tk 8.6.9
Diffstat (limited to 'tk8.6/library/demos/textpeer.tcl')
-rw-r--r--tk8.6/library/demos/textpeer.tcl62
1 files changed, 0 insertions, 62 deletions
diff --git a/tk8.6/library/demos/textpeer.tcl b/tk8.6/library/demos/textpeer.tcl
deleted file mode 100644
index 83e8e14..0000000
--- a/tk8.6/library/demos/textpeer.tcl
+++ /dev/null
@@ -1,62 +0,0 @@
-# textpeer.tcl --
-#
-# This demonstration script creates a pair of text widgets that can edit a
-# single logical buffer. This is particularly useful when editing related text
-# in two (or more) parts of the same file.
-
-if {![info exists widgetDemo]} {
- error "This script should be run from the \"widget\" demo."
-}
-
-package require Tk
-
-set w .textpeer
-catch {destroy $w}
-toplevel $w
-wm title $w "Text Widget Peering Demonstration"
-wm iconname $w "textpeer"
-positionWindow $w
-
-set count 0
-
-## Define a widget that we peer from; it won't ever actually be shown though
-set first [text $w.text[incr count]]
-$first insert end "This is a coupled pair of text widgets; they are peers to "
-$first insert end "each other. They have the same underlying data model, but "
-$first insert end "can show different locations, have different current edit "
-$first insert end "locations, and have different selections. You can also "
-$first insert end "create additional peers of any of these text widgets using "
-$first insert end "the Make Peer button beside the text widget to clone, and "
-$first insert end "delete a particular peer widget using the Delete Peer "
-$first insert end "button."
-
-## Procedures to make and kill clones; most of this is just so that the demo
-## looks nice...
-proc makeClone {w parent} {
- global count
- set t [$parent peer create $w.text[incr count] -yscroll "$w.sb$count set"\
- -height 10 -wrap word]
- set sb [ttk::scrollbar $w.sb$count -command "$t yview" -orient vertical]
- set b1 [button $w.clone$count -command "makeClone $w $t" \
- -text "Make Peer"]
- set b2 [button $w.kill$count -command "killClone $w $count" \
- -text "Delete Peer"]
- set row [expr {$count * 2}]
- grid $t $sb $b1 -sticky nsew -row $row
- grid ^ ^ $b2 -row [incr row]
- grid configure $b1 $b2 -sticky new
- grid rowconfigure $w $b2 -weight 1
-}
-proc killClone {w count} {
- destroy $w.text$count $w.sb$count
- destroy $w.clone$count $w.kill$count
-}
-
-## Now set up the GUI
-makeClone $w $first
-makeClone $w $first
-destroy $first
-
-## See Code / Dismiss buttons
-grid [addSeeDismiss $w.buttons $w] - - -sticky ew -row 5000
-grid columnconfigure $w 0 -weight 1