#
# Side-by-side comparison of Tile vs. standard entry widgets.
#
lappend auto_path . ;
package require tile
. configure -padx 10 -pady 10
grid [tscrollbar .tsb -orient horizontal -command [list .te xview]] -sticky news
grid [tentry .te -textvariable ::A -xscrollcommand [list .tsb set]] -sticky news
grid [entry .e -textvariable ::A -xscrollcommand [list .sb set]] -sticky news
grid [tscrollbar .sb -orient horizontal -command [list .e xview]] -sticky news
grid rowconfigure . 1 -weight 1
grid rowconfigure . 2 -weight 1
grid columnconfigure . 0 -weight 1
.te insert end abcdefghijklmnopqrstuvwxyz
.te configure \
-insertbackground red -selectbackground blue -selectforeground green
.e configure -background white \
-insertbackground red -selectbackground blue -selectforeground green
style theme use alt
#
# Validation test.
#
# "If you can't see the fnords, they can't eat you."
#
proc nofnords {w p} {
if {[set i [string first fnord $p]] >= 0} {
return 0
}
if {[set i [string first FNORD $p]] >= 0} {
$w delete 0 end;
$w insert end [string replace $p $i [expr {$i+4}]]
$w icursor $i
}
return 1
}
.te configure -validatecommand {nofnords %W %P} -validate all
.e configure -validatecommand {nofnords %W %P} -validate all
#*EOF*