(in-package :clim-user)

(define-application-frame test-frame ()
  ()
  (:menu-bar nil)
  (:command-definer nil)
  (:panes
   (stuff :application
          :scroll-bars :vertical
          :display-time :command-loop
          :display-function 'display-stuff-pane)
   (interactor :interactor))
  (:layouts
   (default
       (vertically (:min-width 256
                    :min-height 384
                    :width 256
                    :height 384)
         (3/4 stuff)
         (1/4 interactor)))))

(defun display-stuff-pane (frame pane)
  (formatting-item-list (pane :n-columns 1
                              :y-spacing 10)
    (loop with fm = (frame-manager frame)
          for n below 16
          do (formatting-cell (pane)
               (format pane "~D: " n)
               (with-look-and-feel-realization (fm frame)
                 (with-output-as-gadget (pane)
                   (make-pane 'push-button
                              :client frame
                              :label (format nil "~D" n))))))
    (formatting-cell (pane)
      (format pane "foo")))
  (format pane "~&bar~%"))

(defun launch-test-frame ()
  (run-frame-top-level
   (make-application-frame 'test-frame)))
