Posted to tcl by schelte at Thu Aug 20 13:53:00 GMT 2026view raw

  1. $txtfield tag configure link -foreground blue
  2.  
  3. proc tags {} {
  4. set pos [$::txtfield search -regexp -all -count len {!([a-zA-Z]+)} 1.0]
  5. foreach start $pos num $len {
  6. set end [$::txtfield index "$start + $num chars"]
  7. $::txtfield tag add link $start $end
  8. $::txtfield tag add link[incr link] $start $end
  9. $::txtfield tag bind link$link <1> [list printlink %W link$link]
  10. }
  11. }
  12.  
  13. proc printlink {t link} {
  14. set name [$t get $link.first $link.last]
  15. puts $name
  16. }

Add a comment

Please note that this site uses the meta tags nofollow,noindex for all pages that contain comments.
Items are closed for new comments after 1 week