summaryrefslogtreecommitdiffstats
path: root/demos/demo.tcl
diff options
context:
space:
mode:
authortreectrl <treectrl>2006-09-05 21:54:16 (GMT)
committertreectrl <treectrl>2006-09-05 21:54:16 (GMT)
commitfb6fc11f81c252a15f7e8976965873c5d8a5854e (patch)
tree265f822461ba6302990a3fe78499e5c9564e04fb /demos/demo.tcl
parent9cfeb3544613b13408cf2f87c0b477942a2aed27 (diff)
downloadtktreectrl-fb6fc11f81c252a15f7e8976965873c5d8a5854e.zip
tktreectrl-fb6fc11f81c252a15f7e8976965873c5d8a5854e.tar.gz
tktreectrl-fb6fc11f81c252a15f7e8976965873c5d8a5854e.tar.bz2
Bumped version to 2.1.1.
Removed unused proc. Resize image when loupe window is resized.
Diffstat (limited to 'demos/demo.tcl')
-rw-r--r--demos/demo.tcl25
1 files changed, 15 insertions, 10 deletions
diff --git a/demos/demo.tcl b/demos/demo.tcl
index 0eb918e..9f459a6 100644
--- a/demos/demo.tcl
+++ b/demos/demo.tcl
@@ -1,8 +1,8 @@
#!/bin/wish84.exe
-# RCS: @(#) $Id: demo.tcl,v 1.41 2006/07/11 00:11:29 treectrl Exp $
+# RCS: @(#) $Id: demo.tcl,v 1.42 2006/09/05 21:54:16 treectrl Exp $
-set VERSION 2.1
+set VERSION 2.1.1
package require Tk 8.4
@@ -1415,13 +1415,7 @@ proc CursorWindow {} {
return
}
-proc compare {i1 i2} {
- if {$i1 < $i2} { return -1 }
- if {$i1 == $i2} { return 0 }
- return 1
-}
-
-# A little screen magnifier for X11
+# A little screen magnifier
if {[llength [info commands loupe]]} {
set Loupe(zoom) 3
@@ -1453,7 +1447,18 @@ if {[llength [info commands loupe]]} {
set w [toplevel .loupe]
wm geometry $w -0+0
image create photo ImageLoupe -width 150 -height 150
- pack [label $w.label -image ImageLoupe]
+ pack [label $w.label -image ImageLoupe -borderwidth 0]
+
+ # Resize the image with the window
+ bind LoupeWindow <Configure> {
+ if {%w != [$Loupe(image) cget -width] ||
+ %h != [$Loupe(image) cget -height]} {
+ $Loupe(image) configure -width %w -height %h
+ loupe $Loupe(image) $Loupe(x) $Loupe(y) %w %h $Loupe(zoom)
+ }
+ }
+ bindtags .loupe [concat [bindtags .loupe] LoupeWindow]
+
set Loupe(image) ImageLoupe
set Loupe(delay) 500
after $Loupe(delay) LoupeAfter