stk/Contrib/STk-wtour/lessons/selection.stk

14 lines
373 B
Plaintext
Raw Normal View History

1996-09-27 06:29:02 -04:00
;; X Selection
(pack
[label '.lab :text "Selection is:" :anchor "w"]
[text '.t :relief "raised" :bd 1 :height 15]
[button '.b1 :text "Get Selection"
:command (lambda ()
;; Clear text buffer
(.t 'delete "1.0" "end")
;; Insert selection if it exists
(unless (catch (selection 'get))
(.t 'insert "1.0" (selection 'get))))])