CLIM mail archive


Detecting (to avoid logging) :ACCEPT-VALUES commands

   Date: Fri, 4 Mar 94 16:55:42 CST

   CLIM 2.0-beta on LispWorks 3.2.21-beta-4
   CLIM 2.0 on Allegro 4.2

   I want to log the ordinary commands my application executes, but not
   any commands directed to the :ACCEPT-VALUES pane.  I am using the
   attached code, but it seems a little kludgy, and one vendor is even
   using a command table that my application's command table doesn't
   inherit from.  (Mine inherits from CLIM:ACCEPT-VALUES-PANE, as the
   documentation requires.)  Is there any better way to do this?

This seems reasonable to me in the absence of a well thought-out
theory of interaction journalling in CLIM.  I'm not quite sure what
that read-time conditional is meant to do.

Maybe you want to use clim:command-accessible-in-command-table-p on
the clim:accept-values command table?

	   Lawrence G. Mayka
	   AT&T Bell Laboratories

   Standard disclaimer.

   ;;; Determine whether a command is actually just an action in the :ACCEPT-VALUES pane
   (defun av-command-p (command)
     (let ((command-name (clim:command-name command))
	   (av-command-table (clim:find-command-table
			      #+lispworks 'clim:accept-values-pane
			      #+allegro 'clim:accept-values)))
       (clim:command-present-in-command-table-p command-name av-command-table)))

   ;;; Log each command before executing it
   (defmethod clim:execute-frame-command :before ((self my-appl) command)
     (unless (av-command-p command)
       (let ((log (clim:get-frame-pane self 'log)))
	 (fresh-line log)
	 (write-string "=> " log)
	 (clim:present command '(clim:command :command-table my-appl) :stream log))))


Main Index | Thread Index