stuck over accepting values ..

gwbennett gwbennett at sentex.ca
Sun Jan 12 20:06:39 UTC 2020


Hello from Greg Bennett running sbcl-1.5.8 inside emacs, and using 
mcclim-20181227-git.

TASK: I am trying, unsuccessfully at the moment, to use accepting 
values, in an
environment which I need to define,  to receive something and then make 
it available for subsequent action.

I assume that this must be possible so that applications can receive 
such input.

In mccli ...-git/Examples/accepting-values.lisp I found the defun for 
accepting-tag which seemed a perfect model.
It runs, of course, inside the :clim-demo package as part of the huge 
menu of (demodemo).

It will not run outside that environment, and as Daniel Kochmanski 
kindly explained to me, the reason centres on
the nature of the stream *query-io*. As Daniel suggested, things run 
correctly (outside) if I fire up a clim-listener
and use that as my interface to the code. (My other negotiations with 
clim-listener have been less successful.)

For the project I am working on porting I should like to be able 
accomplish TASK. I have read pieces of the
CLIM 2 User Guide (version 2.2.2) in the hope of finding some 
information that would help,
but my aging brain locks up in the face of its long sequence of 
definitions and code snippets.

However, on p196-7 Section 9.5.1 of that manual there is an example 
(good!) which looks like a version of accepting-tag; it's code is 
attached as p196.lsp. When I try to execute it, I immediately run into 
what I take to be related to the *query-io* difficulty with the error:

There is no class named COMMON-LISP:NIL.
    [Condition of type SB-PCL:CLASS-NOT-FOUND-ERROR]

Some top pieces of the backtrace are attached in p196-log.lsp in case 
they are helpful.

I should be very grateful for pointers to things I have evidently missed 
and/or failed to understand in my attempts
to collect input on the fly.

Cheers /Greg Bennett
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/mcclim-devel/attachments/20200112/e833e5d4/attachment.htm>
-------------- next part --------------
;;; This is p196.lsp
(defpackage #:frame-example
  (:use #:clim-lisp #:clim #:clim-extensions)) 
;;; This is the definition of wb: 

(in-package #:frame-example)

(define-application-frame dingus ()
	((pathname :initform #p"foo")
		(integer :initform 10)
		(member :initform :one))
	(:panes
		(avv :accept-values
			:display-function '(accept-values-pane-displayer :displayer display-avv))
		(display :application
			:display-function 'draw-display
			:display-after-commands :no-clear))
			(:command-table (dingus :inherit-from (accept-values-pane))))

(defmethod draw-display ((frame dingus) stream)
	(with-slots (pathname integer member) frame
		(fresh-line stream)
		(present pathname 'pathname :stream stream)
		(write-string ", " stream)
		(present integer 'integer :stream stream)
		(write-string ", " stream)
		(present member '(member :one :two :three) :stream stream)
		(write-string "." stream)))

(defmethod display-avv ((frame dingus) stream)
	(with-slots (pathname integer member) frame
		(fresh-line stream)
		(setq pathname (accept 'pathname
			:prompt "A pathname" :default pathname
			:stream stream))
		(fresh-line stream)
		(setq integer (accept 'integer
			:prompt "An integer" :default integer
			:stream stream))
		(fresh-line stream)
		(setq member (accept '(member :one :two :three)
			:prompt "One, Two, or Three" :default member
			:stream stream))
		(fresh-line stream)
		(accept-values-command-button (stream :documentation "You wolf!")
			(write-string "Wolf whistle" stream)
			(beep))))

(defun run-dingus (port)
	(let ((dingus (make-application-frame 'dingus
		:parent port :width 400 :height 400)))
	(run-frame-top-level dingus)))
-------------- next part --------------
;;; This is p196-log.lsp
;;; with some bits from trying to run the code on p196.lsp
;;; Greg Bennett is running sbcl-1.5.8 in emacs using mcclim-20191227-git

;;; after loading p196.lsp ..
;;; When I type (run-dingus (find-port)) the immediate result is:
There is no class named COMMON-LISP:NIL.
   [Condition of type SB-PCL:CLASS-NOT-FOUND-ERROR]
;;; In the backtrace, I find
 1: ((:METHOD MAKE-INSTANCE (SYMBOL)) NIL :FRAME #<DINGUS {10059E8703}> :MANAGER #<CLIM-CLX::CLX-FRAME-MANAGER {1001550123}> :PORT #<MCCLIM-TRUETYPE::CLX-TTF-PORT :HOST "" :DISPLAY-ID 0 {10046274E3}> :INP..
      Locals:
        CLASS = NIL
        SB-DEBUG::MORE = (:FRAME #<DINGUS {10059E8703}> :MANAGER #<CLIM-CLX::CLX-FRAME-MANAGER {1001550123}> :PORT #<MCCLIM-TRUETYPE::CLX-TTF-PORT :HOST "" :DISPLAY-ID 0 {10046274E3}> ...)
;;; where the CLASS = NIL is what I presume to be the cause of the ERROR
;;; Immediately before this in the backtrace I find
        SB-DEBUG::MORE = (:FRAME #<DINGUS {10059E8703}> :MANAGER #<CLIM-CLX::CLX-FRAME-MANAGER {1001550123}> :PORT #<MCCLIM-TRUETYPE::CLX-TTF-PORT :HOST "" :DISPLAY-ID 0 {10046274E3}> ...)
  2: ((FLET CALL-NEXT-METHOD :IN "/home/gwbennett/quicklisp/dists/quicklisp/software/mcclim-20191227-git/Core/clim-core/frames.lisp") #<CLIM-CLX::CLX-FRAME-MANAGER {1001550123}> #<DINGUS {10059E8703}> ACCE..
      Locals:
        SB-DEBUG::MORE = (#<CLIM-CLX::CLX-FRAME-MANAGER {1001550123}> #<DINGUS {10059E8703}> ACCEPT-VALUES :INPUT-BUFFER #<CLIM-INTERNALS::CONCURRENT-EVENT-QUEUE {10059E8B23}> :NAME ...)


More information about the mcclim-devel mailing list