Posted to tcl by saedelaere at Fri Feb 20 19:40:11 GMT 2009view raw
- $mf.t_top_newsr insert end "$update_news\n"
- set search_index 0.0
- foreach tag_word [split $word_tags] {
- if {[string trim $tag_word] == {}} continue
- set index [$mf.t_top_newsr search -exact $tag_word $search_index end]
- set word_length [string length $tag_word]
- set index2 "$index + $word_length char"
- $mf.t_top_newsr tag add underline "$index wordstart" "$index2"
- }
- $mf.t_top_newsr configure -state disabled
Comments
Posted by as at Sat Feb 21 00:45:58 GMT 2009 [text] [code]
Simplified test case, WFM: --- % package require Tk 8.5.6 % pack [text .t] % .t insert end "Please" normal "underline" underline "me" normal % .t tag configure underline -underline true --- Results: the text "underline" shows up underlined, as expected.