This 5 minutes hack adds to the CLIM Listener a new "Inspect" command based on the Clouseau inspector:
(in-package :clim-listener)
(define-command (com-inspect :name "Inspect" :command-table lisp-commands :menu t) ((obj 'expression :prompt "expression")) (clouseau::inspector obj))
(define-gesture-name :inspect :pointer-button-press (:middle :control))
(define-presentation-to-command-translator com-inspect-translator (expression com-inspect lisp-commands :menu t :gesture :inspect :documentation ((object stream) (format stream "Inspect ~S" object)) :pointer-documentation "Inspect") (obj) (list obj))
The command works, but the translator sort of.
When I Ctrl-Middle-click on an object with expression presentation type, or right-click and select the "Inspect" command, the Clouseau frame does open, but it does not inspect the right object: it always inspects nil, which is probably what com-inspect actually gets. What am I doing wrong?
I'm not sure the gesture I have chosen is the right one. but Shift-Middle-click is already taken by copy and paste. Any other suggestions?
Also, is expression the right presentation type to hook this functionality into in the first place? Is the translator appropriate?
This tweak to clouseau::inspector makes it possible for the calling frame to continue processing events, especially repaint ones:
(defun inspector (obj) (let ((*print-length* 10) (*print-level* 10)) (run-frame-top-level (make-application-frame 'inspector :calling-frame *application-frame* :obj obj))))
Perhaps it may be worth changing clouseau::inspector so that it can start a new thread in a way similar to clim-listener:run-listener. This way it would be possible to open more than one inspector frame at a time from the Listener.
Paolo
On Fri, 04 Feb 2005 17:06:01 +0100, Paolo Amoroso amoroso@mclink.it wrote:
(defun inspector (obj) (let ((*print-length* 10) (*print-level* 10)) (run-frame-top-level (make-application-frame 'inspector :calling-frame *application-frame* :obj obj))))
Perhaps it may be worth changing clouseau::inspector so that it can start a new thread in a way similar to clim-listener:run-listener. This way it would be possible to open more than one inspector frame at a time from the Listener.
This sounds like a good idea, and I'll add a keyword argument to spawn a new process later today. If you can't wait until tomorrow, this bit of code should do the trick, albeit in a slightly ugly way, now and forevermore:
(clim-sys:make-process #'(lambda () (inspector obj)) :name "Inspector Clouseau")
Where OBJ is the object you want to inspect.
-Peter
Peter Scott sketerpot@gmail.com writes:
This sounds like a good idea, and I'll add a keyword argument to spawn a new process later today. If you can't wait until tomorrow, this bit of code should do the trick, albeit in a slightly ugly way, now and forevermore:
(clim-sys:make-process #'(lambda () (inspector obj)) :name "Inspector Clouseau")
Maybe something like this, which makes the process name more mp:all-processes friendly:
... :name (format nil "Inspector Clouseau: ~S" obj) ...
Take all the time you need, I'm not in a hurry. Thanks,
Paolo
Peter Scott writes:
On Fri, 04 Feb 2005 17:06:01 +0100, Paolo Amoroso amoroso@mclink.it wrote:
(defun inspector (obj) (let ((*print-length* 10) (*print-level* 10)) (run-frame-top-level (make-application-frame 'inspector :calling-frame *application-frame* :obj obj))))
Perhaps it may be worth changing clouseau::inspector so that it can start a new thread in a way similar to clim-listener:run-listener. This way it would be possible to open more than one inspector frame at a time from the Listener.
This sounds like a good idea, and I'll add a keyword argument to spawn a new process later today. If you can't wait until tomorrow, this bit of code should do the trick, albeit in a slightly ugly way, now and forevermore:
(clim-sys:make-process #'(lambda () (inspector obj)) :name "Inspector Clouseau")
Where OBJ is the object you want to inspect.
I thought that functionality was already in there.
Robert Strandh strandh@labri.fr writes:
I thought that functionality was already in there.
You are indeed right, it's in clouseau::com-inspect. But, if I inderstand correctly, it takes its argument interactively.
Paolo
Paolo Amoroso writes:
Robert Strandh strandh@labri.fr writes:
I thought that functionality was already in there.
You are indeed right, it's in clouseau::com-inspect. But, if I inderstand correctly, it takes its argument interactively.
Anything presented should be clickable.
On Sat, 05 Feb 2005 10:52:36 +0100, Paolo Amoroso amoroso@mclink.it wrote:
Robert Strandh strandh@labri.fr writes:
I thought that functionality was already in there.
You are indeed right, it's in clouseau::com-inspect. But, if I inderstand correctly, it takes its argument interactively.
Things have been shuffled around a bit; there's now a new keyword argument to INSPECTOR, :new-process, which tells it to make a new process, and clouseau::com-inspect uses that. This shouldn't require changing any old code, and it's more consistant with the listener.
-Peter