CLIM mail archive

[Prev][Next][Index][Thread]

accepting-values-command-pane



    Date: Wed, 6 May 1992 16:17 EDT
    From: Craig Lanning <CLanning@pdesds1.atg.trc.scra.org>


    What is the intended use of
	CLIM:ACCEPTING-VALUES-COMMAND-PANE
    and how does one use it?  I only found one example of an
    accepting-values-command-pane and it was a very simple one.


    Craig Lanning <CLanning@trc.scra.org>

    P.S. I am using CLIM 1.0 on a Symbolics (Genera 8.1).

It provides the function of a "modeless dialog" embedded in the pane of
an application.

----------------
;;; -*- Mode: LISP; Syntax: ANSI-Common-lisp; Package: CLIM-USER; Base: 10; Lowercase: Yes -*-

(in-package :clim-user)

(define-application-frame sample ()
    ((pathname :initform nil)
     (integer  :initform 0)
     (boolean  :initform nil))
  (:command-table (browser :inherit-from (accept-values-pane)))
  (:panes
    ((display :application
       :display-function 'display-sample
       :display-after-commands ':no-clear)
     (interactor :interactor)
     (control-panel :accept-values
       :display-function '(accept-values-pane-displayer
			    :displayer accept-sample-options))))
  (:layout
    ((default 
       (:column 1
	(display :rest)
	(:row 1/2
	 (:row :rest
	  (interactor 1/2 )
	  (control-panel :rest))))))))

(defmethod accept-sample-options ((frame sample) stream)
  (with-slots (pathname integer boolean) frame
    (flet ((accept (type default prompt)
	     (fresh-line stream)
	     (accept type
		     :stream stream 
		     :default default :prompt prompt)))
      (setq pathname (accept '(null-or-type pathname) pathname "A pathname"))
      (setq integer (accept 'integer integer "An integer"))
      (setq boolean (accept 'boolean boolean "A boolean")))))

(defmethod display-sample ((frame sample) stream)
  (with-slots (pathname integer boolean) frame
    (format stream "~&~S ~S ~S~%" pathname integer boolean)))

(run-frame-top-level 
  (make-application-frame 'sample 
			  :width 600 :height 240
			  :parent (first clim::*sheet-roots*)))


References:

Main Index | Thread Index