#!/usr/bin/wish
# what: Departure/Arrival Style Text Presenter
canvas .c -width 800 -height 100
pack .c
.c create rect {0 0 20 100} -outline darkgreen -fill darkgreen
.c create rect {780 0 800 100} -outline darkgreen -fill darkgreen
.c create rect {0 0 800 30} -outline darkgreen -fill darkgreen
.c create rect {0 70 800 100} -outline darkgreen -fill darkgreen
set alfa [ list { } A B C D E F G H I J K L M N O P Q R S T U V X Y Z 0 1 2 3 4 5 6 7 8 9 : . , ; ]
set Lref [ join $alfa {} ]
set alfa [ join $alfa \n ]
set text_x 100
set text_y 30
set text_xd 20
for {set idx 0} {$idx < 32} { incr idx} {
set text_coords [ list $text_x $text_y ]
set text_tags [ list P$idx Text ]
.c create text $text_coords \
-text $alfa \
-anchor ne \
-font {-size 28} \
-tags $text_tags \
incr text_x $text_xd
}
set Dtext "HANNOVER LH534 19:30 DELAYED 30MIN "
.c lower Text
for {set idx 0} {$idx <= 32} { incr idx} {
set L [ string index $Dtext $idx ]
set offs [ string first $L $Lref ]
puts stderr "L:$L offs:$offs"
set offs [ expr $offs * 40 ]
set wait 0
set del 1
while { $wait < $offs } {
.c move P$idx 0 -1
after $del incr wait
vwait wait
if {($offs - $wait) < 4 } {
set del 50
} elseif {($offs - $wait) < 14 } {
set del 20
}
}
}

See text for more detailsUK The text widget does not realy apply here. I wrote this to have something similar to the "falling segment" type presenters you see used at airports and trainstations using a canvas and moving text items.MSH: This only currently works on unix systems as the sizes are given in pixels and on windows the fonts are specified in points (1/72 inch) not in pixels. The character offset should be calculated using the font metrics command not hard wired.

