diff options
Diffstat (limited to 'library/demos/label.tcl')
-rw-r--r-- | library/demos/label.tcl | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/library/demos/label.tcl b/library/demos/label.tcl index 13463f7..d2823e1 100644 --- a/library/demos/label.tcl +++ b/library/demos/label.tcl @@ -25,16 +25,23 @@ pack $btns -side bottom -fill x frame $w.left frame $w.right -pack $w.left $w.right -side left -expand yes -padx 10 -pady 10 -fill both +pack $w.left $w.right -side left -expand yes -padx 7.5p -pady 7.5p -fill both label $w.left.l1 -text "First label" label $w.left.l2 -text "Second label, raised" -relief raised label $w.left.l3 -text "Third label, sunken" -relief sunken -pack $w.left.l1 $w.left.l2 $w.left.l3 -side top -expand yes -pady 2 -anchor w +pack $w.left.l1 $w.left.l2 $w.left.l3 -side top -expand yes -pady 1.5p -anchor w # Main widget program sets variable tk_demoDirectory image create photo label.ousterhout \ -file [file join $tk_demoDirectory images ouster.png] -label $w.right.picture -borderwidth 2 -relief sunken -image label.ousterhout + +# Create a copy of the image just created, magnified according to the +# display's DPI scaling level. Since the zooom factor must be an integer, +# the copy will only be effectively magnified if $tk::scalingPct >= 200. +image create photo label.ousterhout2 +label.ousterhout2 copy label.ousterhout -zoom [expr {$tk::scalingPct / 100}] + +label $w.right.picture -borderwidth 2 -relief sunken -image label.ousterhout2 label $w.right.caption -text "Tcl/Tk Creator" pack $w.right.picture $w.right.caption -side top |