CLIM mail archive

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

Accept + Mouse-Actions??



[Working in: CLIM-1.1/Lucid/Sun]

The problem: I would like to be in a state that allowed me to do either of
the following simultaneously:

   1] Accept a value (e.g. a number), or

   2] Execute a frame command (specifically through a mouse action).


In a little more detail, the standard state of the system should be that it
is waiting for the user to enter a value of a specified --but arbitrary--
type (say, a number).  However, at the same time the user should be able to
click on one of some set of other objects (e.g. of type MY-PRESTYPE, which
are _not_ of type number) and get the standard mouse actions associated
with that type.

The following gets me _some_ of what I want:

    (with-input-context ('MY-PRESTYPE :stream INPUT-STREAM)
    	                (OBJECT PRESTYPE GESTURE)
          (progn
	    (setq NEW-VALUE
		  (accept PRESTYPE :stream INPUT-STREAM))
	    (new-cell-value SELF NEW-VALUE))
      (MY-PRESTYPE
        (handle-cell-click SELF OBJECT GESTURE)))

However, the problem here is that all I really get is the information that
a mouse-click has occured (on OBJECT).  Moveover, only a left-click works,
so I am limited to only one type of click (actually, mouse-right works
also, but it just gets a menu with the single item in it).  Also, no useful
documentation-line information, etc. etc.


BTW, inverting the above is also interesting (assuming that appropriate
commands have been defined on MY-PRESTYPE):

    (with-input-context ('number :stream INPUT-STREAM)
    	                (OBJECT PRESTYPE GESTURE)
          (progn
	    (setq COMMAND (clim::read-frame-command FRAME :stream INPUT-STREAM))
	    :
	    )
      (number
        (handle-new-value SELF OBJECT GESTURE)))

In this case I can get mouse-actions, of course (because I am handling them myself)
however I can only get numbers by clicking on them (i.e. no typing).

So, my questions are:

  -  Is there some more general way of doing this that allows the full 
     mouse-actions while doing an accept?

  -  If not, is there some way I can get more than one type of mouse-click to
     activate inside the WITH-INPUT-CONTEXT?

Thanks
Nichael



Main Index | Thread Index