Mouse buttons in callbacks




Hello,

I would like to use the different mouse buttons within
a gtk button callback to do different tasks.  How do I
discriminate among the different mouse buttons in the
callback function?  Currently, I have button_press_events,
and button_release_events registered with the button, and
this works OK, execpt I must also trap 
enter_notify_events, and leave_notify_events to ensure that
mouse button 1 executes its command only upon button release.
This involves a static variable in the callback to keep 
track of whether the cursor is on the button when it is
released.  Surely there is a simple way to find which
button was pressed when in a "regular" callback function?


-bob mallozzi

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Robert S. Mallozzi                                          256-544-0887
                                                         Mail Code ES 84
Work: http://crazyhorse.msfc.nasa.gov/      Marshall Space Flight Center 
Play: http://cspar.uah.edu/~mallozzir/              Huntsville, AL 35812
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]