gtk+ r19958 - trunk/modules/other/gail



Author: liyuan
Date: Wed Apr  2 09:29:31 2008
New Revision: 19958
URL: http://svn.gnome.org/viewvc/gtk+?rev=19958&view=rev

Log:
2008-04-02  Li Yuan  <li yuan  sun com>

        * gailbutton.c: (idle_do_action):
        Patch from Alejandro PiÃeiro Iglesias <apinheiro igalia com>.
        Bug #496167. Synthesize press and release GdkEvent in button's click
        action.


Modified:
   trunk/modules/other/gail/ChangeLog
   trunk/modules/other/gail/gailbutton.c

Modified: trunk/modules/other/gail/gailbutton.c
==============================================================================
--- trunk/modules/other/gail/gailbutton.c	(original)
+++ trunk/modules/other/gail/gailbutton.c	Wed Apr  2 09:29:31 2008
@@ -522,7 +522,28 @@
       switch (action_number)
 	{
 	case 0:
-	  gtk_widget_activate (widget);
+	  /* first a press */ 
+
+	  button->in_button = TRUE;
+	  gtk_button_enter (button);
+	  /*
+	   * Simulate a button press event. calling gtk_button_pressed() does
+	   * not get the job done for a GtkOptionMenu.  
+	   */
+	  tmp_event.button.type = GDK_BUTTON_PRESS;
+	  tmp_event.button.window = widget->window;
+	  tmp_event.button.button = 1;
+	  tmp_event.button.send_event = TRUE;
+	  tmp_event.button.time = GDK_CURRENT_TIME;
+	  tmp_event.button.axes = NULL;
+	  
+	  gtk_widget_event (widget, &tmp_event);
+
+	  /* then a release */
+	  tmp_event.button.type = GDK_BUTTON_RELEASE;
+	  gtk_widget_event (widget, &tmp_event);
+	  button->in_button = FALSE;
+	  gtk_button_leave (button); 
 	  break;
 	case 1:
 	  button->in_button = TRUE;



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