CLIM mail archive

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

problems with event functions



    Date: Tue, 4 Jan 1994 06:47 EST
    From: Federico De Martis <demartis@newton.cineca.it>

    Hello, I'm Federico. I'm a student in the University of Udine (course: Science
    of Information) Friuli Venezia Giulia, Italy.

    I'm working on my thesis and trying to learn CLIM 1.0 on "Common Lisp Interface
    Manager (CLIM):  Release 1.0" the worst manual I've neverseen in my life.  
                                                                               
I am quite sure that making insulting remarks about the CLIM 1.0 manual
is not going to make the people who wrote the manual more likely to be
helpful towards you.  Also, I hardly think that the CLIM manuals have
any good claim to being the worst manuals ever; I have seen a large
number of manuals that are even worse than the CLIM manuals.

    I've a problem: there is a function CLIM:EVENT-WINDOW that requires as argument
    <event> ... but nowhere in the manual is shown what event can be.  There areNO
    EXAMPLES... only strings explaining semantic very briefly.  Please, send me a
    list of the possible arguments of that function... otherwise I think that I'll
    be able to burn your manual...

The following is from the CLIM 2.0 User's Guide.  Almost all of this
material is in the CLIM 1.0 User's Guide as well, although I believe
that the name of the section is different.

         GESTURES AND GESTURE NAMES IN CLIM

         A `gesture' in CLIM is an input action by the user, such as typing a character or
         clicking a pointer button. A `pointer gesture' refers to those gestures that involve
         using the pointer.

[2.0]    A gesture spec is a portable way of naming a gesture. For example, the non-
[2.0]    portable ``character'' #\control-shift-C has a gesture spec of (:C :control :shift). For
[2.0]    convenience, the gesture spec for standard Common Lisp characters (the printing
[2.0]    characters, including alphanumerics, ASCII symbols, and #\Space), you can use the
[2.0]    character itself as the gesture spec.

         An `event' is a CLIM object that represents a gesture by the user. (The most impor-
         tant pointer events are those of class CLIM:POINTER-BUTTON-EVENT.)

         A `gesture name' is a symbol that names a gesture or gesture spec. CLIM defines the
         following gesture names: 

              :SELECT      For the most commonly used translator on an object. For example,
                           use the :select gesture while reading an argument to a command
                           to use the indicated object as the argument. 

              :DESCRIBE    For translators that produce a description of an object (such as
                           showing the current state of an object). For example, use the :de-
                           scribe gesture on an object in a CAD program to display the pa-
                           rameters of that object.

              :DELETE      For translators that delete an object. 

              :EDIT        For translators that edit an object. 

              :MODIFY      For translators that somehow modify an object. 

              :MENU        For translators that pop up a menu.

         These correspond to the following events in Genera and in Cloe:

                            Genera              Cloe
         Gesture Name      Gesture             Gesture

         :SELECT           click  Left         click Left
         :DESCRIBE         click  Middle       click Middle
                                               click A-Right
         :MENU             click  Right        click Right
         :DELETE           click  sh-Middle
         :EDIT             click  m-Left
         :MODIFY           click  c-m-Right

         The special gesture name NIL is used in translators that are not directly invokable by
         a pointer gesture. Such a translator can be invoked only from a menu. 

         The special gesture name T means that the translator is available on every gesture.

         You can use CLIM:DEFINE-GESTURE-NAME to define your own gesture names. Avoid
         the temptation to define pointer gestures named :LEFT, :MIDDLE, and :RIGHT; doing so
         can lead you to write less portable applications. If your program use only gesture
         names, they are more portable than if you to specific pointer buttons and keyboard
         keys.


         OPERATORS FOR POINTER GESTURES IN CLIM

[The following are the CLIM 2.0 function names, which are mostly the
same as the names in CLIM 1.1, but not completely the same.]

         The following operators can be used to add or remove new gesture names:

         CLIM:ADD-GESTURE-NAME name type gesture-spec &key (:unique t) 
                   Adds a gesture named name (a symbol) to the set of all gesture names. If
                   :unique is t, an error is signalled if there is already a gesture named name.

         CLIM:DELETE-GESTURE-NAME name 
                   Removes the pointer gesture named gesture-name.

         CLIM:DEFINE-GESTURE-NAME name type gesture-spec &key (:unique t) 
                   Defines a gesture named name by calling CLIM:ADD-GESTURE-NAME.

         The following operators can be used to examine CLIM event objects or match CLIM
         event objects against gesture names.

[CLIM:EVENT-SHEET is the CLIM 2.0 name for CLIM:EVENT-WINDOW]

         CLIM:EVENT-SHEET device-event 
                   Returns the window on which event occurred.

         CLIM:EVENT-MODIFIER-STATE device-event 
                   Returns the state of the keyboard's shift keys when the event event oc-
                   curred.

         CLIM:POINTER-EVENT-BUTTON pointer-button-event 
                   Returns the button number that was pressed when the pointer button event
                   pointer-button-event occurred. The values this can take are
                   CLIM:+POINTER-LEFT-BUTTON+, CLIM:+POINTER-MIDDLE-BUTTON+, or
                   CLIM:+POINTER-RIGHT-BUTTON+.

         CLIM:POINTER-EVENT-X pointer-event 
                   Returns the X position of the pointer when the pointer-event occurred.

         CLIM:POINTER-EVENT-Y pointer-event 
                   Returns the Y position of the pointer when the pointer-event occurred.

         CLIM:KEYBOARD-EVENT-KEY-NAME keyboard-event 
                   Returns the name of the key that was pressed or released in order to gener-
                   ate the keyboard event.

         CLIM:KEYBOARD-EVENT-CHARACTER keyboard-event 
                   Returns the character corresponding to the key that was pressed or re-
                   leased, if there is a corresponding character.

         CLIM:EVENT-MATCHES-GESTURE-NAME-P event gesture-name &optional port 
                   Returns t if the device event event ``matches'' the gesture named by ges-
                   ture-name.

         CLIM:MODIFIER-STATE-MATCHES-GESTURE-NAME-P state gesture-name 
                   Returns t if the modifer state state ``matches'' the modifier state of the
                   gesture named by gesture-name.

         CLIM:MAKE-MODIFIER-STATE &rest modifiers 
                   Given a set of modifier key names, CLIM:MAKE-MODIFIER-STATE returns a
                   modifier state corresponding to those keys.

         The following constants are the values that can be taken on by CLIM:EVENT-
         MODIFIER-STATE. Note that these are bit values that can be combined with ``logical
         or'' when multiple modifier keys are being held down by the user.

         CLIM:+SHIFT-KEY+ 
                   The modifier state bit that corresponds to the user holding down the shift
                   key on the keyboard.

         CLIM:+CONTROL-KEY+ 
                   The modifier state bit that corresponds to the user holding down the control
                   key on the keyboard.

         CLIM:+META-KEY+ 
                   The modifier state bit that corresponds to the user holding down the meta
                   key on the keyboard.

         CLIM:+SUPER-KEY+ 
                   The modifier state bit that corresponds to the user holding down the super
                   key on the keyboard.

         CLIM:+HYPER-KEY+ 
                   The modifier state bit that corresponds to the user holding down the hyper
                   key on the keyboard.

         The following constants are the values that can be taken on by CLIM:POINTER-
         EVENT-BUTTON.

         CLIM:+POINTER-LEFT-BUTTON+ 
                   The value returned by CLIM:POINTER-EVENT-BUTTON that corresponds to the
                   user having pressed or released the lefthand button on the pointer.

         CLIM:+POINTER-MIDDLE-BUTTON+ 
                   The value returned by CLIM:POINTER-EVENT-BUTTON that corresponds to the
                   user having pressed or released the middle button on the pointer.

         CLIM:+POINTER-RIGHT-BUTTON+ 
                   The value returned by CLIM:POINTER-EVENT-BUTTON that corresponds to the
                   user having pressed or released the righthand button on the pointer.

    Ciao. Please, unswere soon.

I hope the above unsweres your questions.

References:

Main Index | Thread Index