summaryrefslogtreecommitdiffstats
path: root/library/demos
diff options
context:
space:
mode:
Diffstat (limited to 'library/demos')
-rw-r--r--library/demos/combo.tcl3
-rw-r--r--library/demos/cscroll.tcl12
-rw-r--r--library/demos/entry1.tcl2
-rw-r--r--library/demos/entry2.tcl1
-rw-r--r--library/demos/goldberg.tcl12
-rw-r--r--library/demos/menu.tcl9
-rw-r--r--library/demos/tree.tcl1
-rw-r--r--library/demos/unicodeout.tcl4
8 files changed, 33 insertions, 11 deletions
diff --git a/library/demos/combo.tcl b/library/demos/combo.tcl
index 8631904..acab497 100644
--- a/library/demos/combo.tcl
+++ b/library/demos/combo.tcl
@@ -43,7 +43,8 @@ set secondValue unchangable
set ozCity Sydney
ttk::labelframe $w.c1 -text "Fully Editable"
-ttk::combobox $w.c1.c -textvariable firstValue
+ttk::combobox $w.c1.c -textvariable firstValue -placeholder {Enter text here}
+ttk::style configure TEntry -placeholderforeground gray50
ttk::labelframe $w.c2 -text Disabled
ttk::combobox $w.c2.c -textvariable secondValue -state disabled
ttk::labelframe $w.c3 -text "Defined List Only"
diff --git a/library/demos/cscroll.tcl b/library/demos/cscroll.tcl
index f64ca5d..f906c7d 100644
--- a/library/demos/cscroll.tcl
+++ b/library/demos/cscroll.tcl
@@ -127,6 +127,18 @@ if {[tk windowingsystem] eq "x11"} {
%W xview scroll 5 units
}
}
+ if {[package vsatisfies [package provide Tk] 8.7]} {
+ bind $c <Button-6> {
+ if {!$tk_strictMotif} {
+ %W xview scroll -5 units
+ }
+ }
+ bind $c <Button-7> {
+ if {!$tk_strictMotif} {
+ %W xview scroll 5 units
+ }
+ }
+ }
}
diff --git a/library/demos/entry1.tcl b/library/demos/entry1.tcl
index 7365fc7..58eda03 100644
--- a/library/demos/entry1.tcl
+++ b/library/demos/entry1.tcl
@@ -25,7 +25,7 @@ pack $btns -side bottom -fill x
entry $w.e1
entry $w.e2
-entry $w.e3
+entry $w.e3 -placeholder {Enter text here} -placeholderforeground gray75
pack $w.e1 $w.e2 $w.e3 -side top -pady 5 -padx 10 -fill x
$w.e1 insert 0 "Initial value"
diff --git a/library/demos/entry2.tcl b/library/demos/entry2.tcl
index 6405d85..1423e3f 100644
--- a/library/demos/entry2.tcl
+++ b/library/demos/entry2.tcl
@@ -44,3 +44,4 @@ $w.frame.e1 insert 0 "Initial value"
$w.frame.e2 insert end "This entry contains a long value, much too long "
$w.frame.e2 insert end "to fit in the window at one time, so long in fact "
$w.frame.e2 insert end "that you'll have to scan or scroll to see the end."
+$w.frame.e3 configure -placeholder {Enter text here} -placeholderforeground gray75
diff --git a/library/demos/goldberg.tcl b/library/demos/goldberg.tcl
index 284b5c2..1cc52c6 100644
--- a/library/demos/goldberg.tcl
+++ b/library/demos/goldberg.tcl
@@ -105,7 +105,7 @@ proc DoDisplay {w} {
$w.c yview moveto .05
pack $w.c -in $w.screen -side top -fill both -expand 1
- bind $w.c <3> [list $w.pause invoke]
+ bind $w.c <Button-3> [list $w.pause invoke]
bind $w.c <Destroy> {
after cancel $animationCallbacks(goldberg)
unset animationCallbacks(goldberg)
@@ -162,7 +162,7 @@ proc DoCtrlFrame {w} {
grid $w.speed -in $w.ctrl -row 99 -sticky ew -pady {0 5}
pack $w.speed.scale -fill both -expand 1
grid $w.about -in $w.ctrl -row 100 -sticky ew
- bind $w.reset <3> {set S(mode) -1} ;# Debugging
+ bind $w.reset <Button-3> {set S(mode) -1} ;# Debugging
## See Code / Dismiss buttons hack!
set btns [addSeeDismiss $w.ctrl.buttons $w]
@@ -342,7 +342,7 @@ proc Draw0 {w} {
set xy {719 119 763 119}
$w.c create line $xy -tag I0 -fill $color -width 5 -arrow last \
-arrowshape {18 18 5}
- $w.c bind I0 <1> Start
+ $w.c bind I0 <Button-1> Start
}
proc Move0 {w {step {}}} {
set step [GetStep 0 $step]
@@ -372,7 +372,7 @@ proc Draw1 {w} {
set xy [box 812 122 9]
$w.c create oval $xy -tag I1 -fill $color2 -outline {}
- $w.c bind I1 <1> Start
+ $w.c bind I1 <Button-1> Start
}
proc Move1 {w {step {}}} {
set step [GetStep 1 $step]
@@ -1620,7 +1620,7 @@ proc Move26 {w {step {}}} {
$w.c delete I24 I26
$w.c create text 430 755 -anchor s -tag I26 \
-text "click to continue" -font {{Times Roman} 24 bold}
- bind $w.c <1> [list Reset $w]
+ bind $w.c <Button-1> [list Reset $w]
return 4
}
@@ -1675,7 +1675,7 @@ proc RotateC {x y Ox Oy beta} {
proc Reset {w} {
global S
DrawAll $w
- bind $w.c <1> {}
+ bind $w.c <Button-1> {}
set S(mode) $::MSTART
set S(active) 0
}
diff --git a/library/demos/menu.tcl b/library/demos/menu.tcl
index a788a65..abe70a3 100644
--- a/library/demos/menu.tcl
+++ b/library/demos/menu.tcl
@@ -131,7 +131,7 @@ $m entryconfigure 2 -columnbreak 1
set m $w.menu.more
$w.menu add cascade -label "More" -menu $m -underline 0
menu $m -tearoff 0
-foreach i {{An entry} {Another entry} {Does nothing} {Does almost nothing} {Make life meaningful}} {
+foreach i {{An entry} {Another entry} {Does nothing} {Does almost nothing} {Does almost nothing also} {Make life meaningful}} {
$m add command -label $i -command [list puts "You invoked \"$i\""]
}
$m entryconfigure "Does almost nothing" -bitmap questhead -compound left \
@@ -141,6 +141,13 @@ $m entryconfigure "Does almost nothing" -bitmap questhead -compound left \
text string. Other than this, it is just like any other\
menu entry." {} 0 OK ]
+$m entryconfigure "Does almost nothing also" -image lilearth -compound left \
+ -command [list \
+ tk_dialog $w.compound {Compound Menu Entry} \
+ "The menu entry you invoked displays both a image and a\
+ text string. Other than this, it is just like any other\
+ menu entry." {} 0 OK ]
+
set m $w.menu.colors
$w.menu add cascade -label "Colors" -menu $m -underline 1
menu $m -tearoff 1
diff --git a/library/demos/tree.tcl b/library/demos/tree.tcl
index 8decdf2..1cc70f8 100644
--- a/library/demos/tree.tcl
+++ b/library/demos/tree.tcl
@@ -39,6 +39,7 @@ proc populateTree {tree node} {
set path [$tree set $node fullpath]
$tree delete [$tree children $node]
foreach f [lsort -dictionary [glob -nocomplain -dir $path *]] {
+ set f [file normalize $f]
set type [file type $f]
set id [$tree insert $node end -text [file tail $f] \
-values [list $f $type]]
diff --git a/library/demos/unicodeout.tcl b/library/demos/unicodeout.tcl
index bb4d8f8..ca325a4 100644
--- a/library/demos/unicodeout.tcl
+++ b/library/demos/unicodeout.tcl
@@ -22,8 +22,8 @@ label $w.msg -font $font -wraplength 4i -anchor w -justify left \
below depends largely on what character sets you have installed,\
and what you see for characters that are not present varies greatly\
between platforms as well. The strings are written in Tcl using\
- UNICODE characters using the \\uXXXX escape so as to do so in a\
- portable fashion."
+ UNICODE characters using the \\uXXXX (or \\UXXXXXX) escape so as to\
+ do so in a portable fashion."
pack $w.msg -side top
## See Code / Dismiss buttons