CLIM mail archive

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

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.

Sincerely,

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)

  (values 
    (let ((possibilities '(("One" 1) ("Two" 2) ("Three" 3))))
      (clim:complete-input
	stream
	#'(lambda (string action)
	     (clim:complete-from-possibilities
	       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
			  ()
  ()
  (:panes
    ((main  :application
	    :incremental-redisplay nil
	    :display-function 'draw-main
	    :default-size :rest
	    )
     (doc :pointer-documentation)
     (test-menu  :command-menu)))
   (:command-table
    (test-menu
     :inherit-from (user-command-table)
     :menu
     (("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*)
  )


References:

Main Index | Thread Index