Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > updates > by-pkgid > 39fccafb9cc33eb5e2c44828f5a62bff > files > 33

lush-2.0-1.fc14.x86_64.rpm

#!/bin/sh
exec lush2 "$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)