]> Pileus Git - ~andy/gtk/commitdiff
examples: Use symbolic names for button numbers
authorCarlos Garcia Campos <cgarcia@igalia.com>
Wed, 25 Jan 2012 18:10:47 +0000 (19:10 +0100)
committerCarlos Garcia Campos <carlosgc@gnome.org>
Fri, 27 Jan 2012 08:47:44 +0000 (09:47 +0100)
examples/drawing.c

index 1534b451bcbb0a5710b560bacd2a9ef9fa7d3a0a..68fb81eabc215d395be37fbe8f64bcb371cf31ef 100644 (file)
@@ -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);