CLIM mail archive


two questions revisited

    Date: Fri, 3 Apr 1992 03:14 EST

        Two questions:

    > You haven't said what system you are using.  I'll repeat my quarterly
    > request to everyone on this list to explicitly say something like "CLIM
    > 1.1 under Allegro Common Lisp 4.0.2".  Thanks.

    So here I'm trying again.

I still don't have enough information to reproduce this.  You'll really
need to supply an entire, simplified, reproducible test-case.  When I do
things that look what you have supplied below, it works fine.  This area
of CLIM hasn't changed much from CLIM 1.0 to CLIM 1.1, either.  I'm sorry
that I haven't been more helpful so far.

    I'm using CLIM 1.0 and MCL 1.0 (both beta). First I define som
    presentation types and a present method:

    (clim:define-presentation-type model-&-label ())

    ; (defclass node (model-&-label)) ; make node a subclass of model-&-label
    (clim:define-presentation-type node ())

    (clim:define-presentation-method clim:present
      (obj (type model-&-label) stream (view clim:textual-view) &key)
      (print-without-type obj stream))

    Then I make an accept method, which is supposed to get a value from a
    homemade cut-buffer:

    (clim:define-presentation-method clim:accept
      ((type model-&-label) stream (view clim:textual-view) &key)
      (let* ((view (frame-view clim:*application-frame*))
             (graph (view-graph view)))
        (let ((chosen-object (get-chosen-object view type))) ; look in cut-buffer
          (if (and *use-objects-when-accepting-p* chosen-object)
            (progn (unchoose-object view chosen-object)
                   (clim:presentation-replace-input stream chosen-object type view)
                    ; ^^^^^^^^^^^^^^^^^^^^^^^^^^ does not use my present-method
                   (values chosen-object))
            (values ; if no value in cut-buffer use standard completion
             (clim:completing-from-suggestions (stream)
                (mapc #'(lambda (graph-object)
                          (clim:suggest (ensure-label graph-object) graph-object))
                      (complete-from-graph-object graph type)))))

    As state in the code, clim:presentation-replace-input does not use my
    own present method but one that calls print-object. Using present with
    the same argument works but then the output of course isn't put into
    the input-buffer. Help!

        2. The command line echoes the argument list when I type <space> after
        entering the command name. How can I prevent that behaviour?

    > What "argument list"?  Please describe this more specifically.

    My second problem concerns the command line: When pressing <space>
    after entering" Beep Object" CLIM outputs "(node-or-edge)", i.e. a
    kind of prompt for either *one* argument or the *whole* argument-list.
    The command line looks like this:

    Command: Beep Object (node-or-edge) <here is the caret>

    This is the definition of the command:

    (define-view-frame-command (com-beep-object :name t)
                               ((node-or-edge '(or node edge))) ; 'model-&-label))

    Can I prevent the output of "(node-or-edge)"?

That's what :PROMPT NIL is for:

 (define-view-frame-command (com-beep-object :name t)
                            ((node-or-edge '(or node edge)
                              :PROMPT NIL))


Main Index | Thread Index