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
Hey Greg,
your code doesn't comiple for me. i.e application frame definition doesn't have the layouts section. Also it seems that your McCLIM version is over one year old while in a meantime the codebase had numerous improvements.
Regarding accepting values, first I've wanted to give you a small snippet, but it resulted in the issue created: https://github.com/McCLIM/McCLIM/issues/941
Either way it would be helpful if you could provide a verbal description what you want to achieve. Here is how you could i.e accept an integer from inside the application frame:
(in-package clim-user)
(define-application-frame frame-which-accepts-values () ((accepted-integer :initform nil :accessor accepted-integer)) (:pane :application :display-function (lambda (frame pane) (format pane "Hey!~%") (format pane "Accepted integer is: ~s~%" (accepted-integer frame)) (with-output-as-gadget (pane) (make-pane :push-button :label "Accept integer!" :activate-callback (lambda (gadget) (setf (accepted-integer frame) (accepting-values (stream :own-window t) (fresh-line stream) (accept 'integer :stream stream))) (redisplay-frame-pane frame pane)))) (terpri pane) (format pane "Bye!~%"))))
(run-frame-top-level (make-application-frame 'frame-which-accepts-values))
Best regard, Daniel
-- Daniel Kochmański ;; aka jackdaniel | Przemyśl, Poland TurtleWare - Daniel Kochmański | www.turtleware.eu
"Be the change that you wish to see in the world." - Mahatma Gandhi