CLIM mail archive


How to influence command line arguments help facility

Howdy Mr. Eggemeyer,

Complete-input and Complete-from-suggestions both offer a
:possibility-printer keyword.  I ran the following example on
Lucid's implementation of CLIM 1.1 and the type (ie, cardinal), not
all the possibilities, was listed.

I'm not sure this is what you're looking for, but thought it might
be helpful.


John S. Kern
Lucid, Inc. 
Customer Support
(in-package :clim-user)

;;; I have slightly modified the dictionary entry for
;;; complete-from-possibilities with the :possibility-printer
;;; keyword and added supporting code.

(define-presentation-type cardinal ())

(define-presentation-method accept ((type cardinal) stream 
				    (view clim:textual-view) &key)

    (let ((possibilities '(("One" 1) ("Two" 2) ("Three" 3))))
	#'(lambda (string action)
	       string possibilities nil
	       :action action))
	:possibility-printer #'print-it))

(defun print-it (possibility cardinal stream)
  (format stream "howdy ~S " possibility ))

(defun complete-it ()
  (let ((stream (get-frame-pane *application-frame* 'main)))
    (accept 'cardinal :stream stream)))
(define-application-frame experient
    ((main  :application
	    :incremental-redisplay nil
	    :display-function 'draw-main
	    :default-size :rest
     (doc :pointer-documentation)
     (test-menu  :command-menu)))
     :inherit-from (user-command-table)
     (("EXIT"      :command cmd-exit)
      ("OK" :command complete-it)

(defmethod draw-main ((frame experient) stream)

(defun run (root)
  (let ((frame (make-application-frame 'experient
					:parent root
					:left 0
					:top 0
					:right 500
					:bottom 500)))
    (run-frame-top-level frame)

(defun cmd-exit ()
  (frame-exit *application-frame*)


Main Index | Thread Index