This is an empty page.

Enter page contents here or click cancel to leave it empty.


 # tagRollover.tcl

 #!/bin/sh
 # the next line restarts using tclsh \
 exec tclsh "$0" "$@"

 package require Gnocl

 set text [gnocl::text ]

 set _tag_rollOver(baseClr) blue
 set _tag_rollOver(highlight) red

 $text tag create _tag_default \
        -onEvent {
                set t %t
                set w %w
                if { $t == "motionNotify" } {
                        $w tag configure _tag_rollOver -foreground $_tag_rollover(baseClr)
                }
        }

 $text tag create _tag_rollOver \
        -fontWeight bold \
        -foreground $_tag_rollover(baseClr) \
        -onEvent {
                set t %t
                set w %w
                if { $t == "motionNotify" } {
                        $w tag configure _tag_rollOver -foreground $_tag_rollOver(highlight)
                }
        }

 $text configure -onKeyPress {
        $text tag apply {0 0} end -tags _tag_default
 }

 $text insert end "This is " -tags _tag_default
 $text insert end "Gnocl" -tags _tag_rollOver
 $text insert end "!\n" -tags _tag_default

 gnocl::window -title "Text TagRollover Effext" -child $text
 gnocl::mainLoop

enter categories here