[gtk+] examples: Use symbolic names for button numbers



commit 80b414efc255c1b68132d928f984b61a16e48307
Author: Carlos Garcia Campos <cgarcia igalia com>
Date:   Wed Jan 25 19:10:47 2012 +0100

    examples: Use symbolic names for button numbers

 examples/drawing.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/examples/drawing.c b/examples/drawing.c
index 1534b45..68fb81e 100644
--- a/examples/drawing.c
+++ b/examples/drawing.c
@@ -86,11 +86,11 @@ button_press_event_cb (GtkWidget      *widget,
   if (surface == NULL)
     return FALSE;
 
-  if (event->button == 1)
+  if (event->button == GDK_BUTTON_PRIMARY)
     {
       draw_brush (widget, event->x, event->y);
     }
-  else if (event->button == 3)
+  else if (event->button == GDK_BUTTON_SECONDARY)
     {
       clear_surface ();
       gtk_widget_queue_draw (widget);



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