Test
Source
#
# 流れるテキスト
#
# text: 流すテキスト
# num: テキストをずらす数
# space: 空白の数
#
proc ScrollText { text num space } {
set length [expr [string length $text] + $space]
set num [expr $num % $length]
set s ""
set space
for { set i $space } { $i > 0 } { incr i -1 } { set s $s. }
set text $text$s
set first ""
set last ""
set first [string range $text 0 [expr $num - 1] ]
set last [string range $text $num end]
set text $last$first
return $text
}
set text {Hello!! This Script is wirriten by Tcl/Tk. If you are intrested in Tcl/Tk, you can see this script source. Bye!}
set space 10
set count 0
text .t -relief flat -width 30 -height 1 -bg black -fg palegreen
pack .t
proc Run {} {
global text space count
after cancel Run
.t delete 1.0 end
.t insert end [ScrollText $text $count $space]
incr count
after 300 Run
update
}
eval Run
ホームページへ戻る