;;; -*- Mode: LISP; Syntax: Ansi-Common-Lisp; Base: 10; Package: com.symsim.oss.postgis-gui; -*- 

(ql:quickload :mcclim)

(in-package :clim-user)

(define-application-frame test-gadgets ()
  ()
  (:panes
   (output
    :application
    :display-time :command-loop
    :display-function 'display-gadgets))
  (:layouts
   (default output)))

(defmethod display-gadgets ((frame test-gadgets) stream)
  (dolist (item '("one" "two" "three" "four"))
    (with-look-and-feel-realization ((frame-manager *application-frame*) *application-frame*)
      (with-output-as-gadget (stream)
	(make-pane 'push-button
		   :label item
		   :activate-callback
		   (lambda (&rest args)
		     (declare (ignore args))
		     (notify-user *application-frame* "You clicked a button")))))
    (terpri stream)))

(run-frame-top-level (make-application-frame 'test-gadgets))
