CLIM mail archive

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

selective accepts



    Date: Tue, 25 Aug 1992 16:54 EDT
    From: Tom Trinko <ttrinko@dipl.rdd.lmsc.lockheed.com>

    This is probably a simple question but I'm having trouble with accept using
    genera 8.1 and clim 1.1.  I have a number of different objects displayed which
    all use the same presentation type.  When I start a certain activity, which
    allows the user to select a series of nodes in a graph, I want to have only 
    those nodes which are directly connected to the last node be mouse sensative.
    I also don't want the lines which connect the nodes to be mouse sensitve even 
    though they use the same presentation type as the nodes.  

Why are the edges the same presentation type as the nodes?  That doesn't
seem right to me.

    The accept statement looks like this`
       (accept '((class :connected-with last-node)...

    The parameters are used correctly because when you've been prompted to make a 
    selection if you hit the help key you get a list of only the directly connected
    nodes.  Unfortunetly all of the objects are mouse sensitive if you move the 
    mouse over them.  

    I checked and determined that both presentation-typep and presentation-subtypep
    are returning the correct values, ie when the mouse moves over an object other
    than the nearest nodes presentation-typep returns nil and presentation subtypep
    returns (nil,t).

    I'd appreciate any help, also I'd like to know what I can modify to control
    which objects are hightlited when the mouse moves over them.  I thought that was
    partially controlled by accept and presentation-typep but I guess I was wrong.

There is also a bug in IDENTITY-TRANSLATOR-APPLICABLE-P, which has been
discussed here before.  Try this definition for it instead:

(defun identity-translator-applicable-p (presentation context-type)
  (let* ((type (presentation-type presentation))
	 (type-name (presentation-type-name type))
	 (object (presentation-object presentation)))
    (with-presentation-type-decoded (context-name context-parameters) context-type
      (if (eq type-name 'blank-area)
	  (eq context-name 'blank-area)
	;; Let MENU-ITEM-IDENTITY take care of pure menu items
	(unless (and (eq type-name 'menu-item)
		     (eq context-name 'menu-item))
	  ;; Either the types definitely match, or the types nominally match
	  ;; and the object must be validated.
	  (or (presentation-subtypep type context-type)
	      (and (not (null context-parameters))
		   (presentation-typep object context-type))))))))


References:

Main Index | Thread Index