Posted to tcl by patthoyts at Tue Mar 22 00:17:59 GMT 2011view raw

  1. (load :ltk)
  2. (use-package :ltk)
  3.  
  4. (defun show-message (text)
  5. "Show message in a label on a Tk window"
  6. (with-ltk ()
  7. (let* ((label (make-instance 'label :text text))
  8. (button (make-instance 'button :text "Done"
  9. :command (lambda ()
  10. (ltk::break-mainloop)
  11. (ltk::update)))))
  12. (pack label :side :top :expand t :fill :both)
  13. (pack button :side :right)
  14. (mainloop))))
  15.  
  16. (show-message "Goodbye world")