[g-a-devel] How to tell if a button has been clicked?



Greetings,
 
Suppose the user of the Gnome desktop does this:
 
1. runs and app with a button on it
2. moves the mouse on top of the button
3. presses the left mouse button down on the button
4. moves the mouse off the button
5. releases the left mouse button
 
When you do this, the button is not clicked, that is, the signal handler in the app for "clicked" is not called.
 
What at-spi event sequence would reveal this to an accessibility application?   The best solution I've come up with so far is to record the bounding box of the widget on which the mouse was pressed and, in the button-release handler, check to see if the mouse is still inside that bounding box.
 
Is there a better way?
 
I just finished adding event handlers for Gtk:GtkWidget:button-press-event and Gtk:GtkWidget:button-release-event.  In the above situation my app gets both events and even though the mouse is no longer on the button when the user releases the mouse button, the Gtk:GtkWidget:button-release-event source object is the button.  Is this a bug?
 
-Sam


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