;;;  A basic text widget, with tag bindings

(text '.text :yscrollcommand (lambda l (apply .scroll 'set l)) :wrap "word")
(scrollbar '.scroll :relief "flat" :command (lambda l (apply l .text 'yview l)))

(pack .scroll :side "right" :fill "y")
(pack .text :expand #t :fill "both")


(.text 'insert 'current 
"This is a text widget, with some tagged text:\n\n\n\n
Press me!!!")

(.text 'tag 'configure 'footag :relief "raised" :borderwidth 3 :background "bisque")
(.text 'tag 'add 'footag "end-1l linestart" "end-1c")

(.text 'tag 'bind 'footag "<ButtonPress-1>" (lambda () (display "Gotcha!\n")))


