#!/bin/sh
exec lush "$0" "$@"
!#

;; A simple Ogre GUI demo
(when (or (member "-h" argv)
          (member "--help" argv))
  (writing "$stderr" 
   (render-brace-text 0 72
   '{<p> Synopsis: ,,(basename (car argv)) [-h]{<br>}
     A simple demo of a GUI applications in Lush.
     Option "-h" shows this message. 
     }))
  (exit 0))

(ogre)
(printf "This script is 10 lines long\n")
(setq win 
  (new autowindowobject 10 10 100 100 "Simple GUI" 
    (new column
      (new stdbutton "hit me" (lambda (c) (printf "OUCH\n")))
      (new stdbutton "feed me" (lambda (c) (printf "CRUNCH\n")))
      (new stdbutton "quit forcefully" (lambda (c) (exit 0)))
      (new stdbutton "quit gracefully" (lambda (c) (delete win))))))
(wait win)






