CLIM mail archive

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

execute-frame-command



    Date: Thu, 16 Dec 1993 17:15 EST
    From: Massimo Paolucci <paolucci+@pitt.edu>

    CLIM1.1

    I defined a command 

    (define-belvedere-frame-command (INSERT-TEXT)
	((display-record 'media-instance))
      (when display-record
	(add-text display-record)))


    and I want to call this command from a method in a generic function 


    (defgeneric  select-object (picture)
      (:method ((picture kb:graphic-object))
	       ...)
      ;;
      ;; **** HERE IS THE IMPORTANT PART
      (:method ((icon add-text-icon))
	       (clim:execute-frame-command clim:*application-frame* 'insert-text))

The object 'insert-text is not a command -- it is a command name.
You need to do this:

  (clim:execute-frame-command
    clim:*application-frame* `(insert-text ,clim:*unsupplied-argument-marker*))

      ;;
      (:method ((icon pallette-icon))
	       ....)
      (:method ((icon COLOR-ICON))
	       ...)
      (:method ((anythingelse t))
	       ()))

    I had the following error

    >>Error: #<Unknown-Object -1B1EEF75> is not coercible to a procedure to
    funcall or apply

    (METHOD CLIM:EXECUTE-FRAME-COMMAND (CLIM:APPLICATION-FRAME T)):
       Required arg 0 (FRAME): CLIM:*APPLICATION-FRAME*
       Required arg 1 (COMMAND): #<Belvedere-Frame #X11E72CA6>
    :C  0: Supply a new function
    :A  1: Return to Belvedere: Document-2 command level
	2: Belvedere: Document-2 top level
	3: Exit Belvedere: Document-2
	4: Kill process #<Process Belvedere: Document-2 11E8ABE6>
	5: Restart process #<Process Belvedere: Document-2 11E8ABE6>
    -> 


    How clim:execute-frame-command is used?

    Thank

    - Massimo





References:

Main Index | Thread Index