CLIM mail archive

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

Problem using Handle-event



   Date:     Fri, 8 Jul 94 9:22:18 EDT
   From: Nichael Cramer <ncramer@BBN.COM>

   >From: Scott McKay <swm@harlequin.com>
   >   From: Nichael Cramer <ncramer@BBN.COM>
   >   >From: martin@cs.rochester.edu
   >   >We are trying to capture the keyboard input so we can build a string
   >   >while CLIM is displaying information it reads from the stream.  From
   >   >reading the manual it looks like we want to specialize handle-event so
   >   >that it builds the string in addition to whatever else it is doing.
   >   >The problem is that handle-event does not sem to process anything
   >   >except pointer-exit and pointer-enter events.  We built a small test
   >   >application which specialized handle-event to print the type of the
   >   >event on the window.  The code follows.
   >   >
   >   >Does anyone have any suggestions about how to gather up the keyboard
   >   >input while processing clim commands from another source?  Also, does
   >   >anyone know what handle-event is supposed to do?
   >
   >   In short you _can't_ get at the events.  The problem is that the
   >   APPLICATION-PANE that you are using is built on top of the various Clim
   >   STREAM-ish mixins.  These mixins apparently snatch all the events at a very
   >   low level.  (The documentation is very vague on this point.)
   >
   >   If you want to do any of the event-handling you need to build up your own
   >   gadgets, basically starting with something like SILICA::LEAF-PANE (which is
   >   crudely analogous to something like tv:WINDOW on the SMBX machines --i.e. a
   >   raw window that you can draw on and not much else.)
   >
   >For CLIM stream panes, I think you can probably safely wrap an :AROUND
   >method on the CLIM-INTERNALS::RECEIVE-GESTURE method.

   Thanks this is good to know, but the question still remains why didn't
   Martin's code work in the first place?

   Surely Martin did The Right Thing; i.e. he followed the event protocol as
   outlined by any reasonable reading of the documentation.  But as he
   discovered, this simply doesn't work.  On the other hand, if there are
   compelling reasons why the events can/will not work with stream-panes (and
   others) then IWBNI there was at least a footnote in the documentation for
   the events to the effect that "BTW, none of this works with streams".

   Also the problem with work-arounds such as the one described above (:around
   methods attached to undocumented internal methods) is that experience shows
   that they have a non-negligible chance of not surviving the next CLIM
   release.

For reasons I cannot remember, CLIM streams do not use the usual
HANDLE-EVENT mechanism.

If you are insistent on obeying protocol more strictly, you can wrap
an :AROUND method on QUEUE-EVENT, but this means the event logging
code will run in the CLIM event process.


Main Index | Thread Index