; $Header: /home/campbell/Languages/Scheme/scm/x-scm/RCS/xhello.scm,v 1.1 1992/07/03 03:06:52 campbell Beta $
;
; "Hello, world" button sample program for xmscm
;
;  Author: Larry Campbell (campbell@redsox.bsw.com)
; 
;  Copyright 1992 by The Boston Software Works, Inc.
;  Permission to use for any purpose whatsoever granted, as long
;  as this copyright notice remains intact.  Please send bug fixes
;  or enhancements to the above email address.
; 
(require (in-vicinity (library-vicinity) "x11.scm"))
(require (in-vicinity (library-vicinity) "xt.scm"))
(require (in-vicinity (library-vicinity) "xm.scm"))

(define top-level
  (xt:initialize "hello" "Hello"))

(define button
  (xt:create-managed-widget
   "Hello" xm:push-button top-level))

(xt:add-callback
 button xm:n-activate-callback
 (let ((toggled #f))
   (lambda (widget)
     (if toggled
	 (quit)
	 (begin
	   (xt:set-values
	    widget xm:n-label-string (xm:string-create "Goodbye!"))
	   (set! toggled #t))))))

(xt:realize-widget top-level)
(xt:main-loop)
