style
[psensor.git] / src / ui_graph.c
index 14fb6ef..ddc4e97 100644 (file)
@@ -1,22 +1,21 @@
 /*
-    Copyright (C) 2010-2011 jeanfi@gmail.com
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-    02110-1301 USA
-*/
-
+ * Copyright (C) 2010-2011 jeanfi@gmail.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
 #include "graph.h"
 #include "ui_graph.h"
 #include "ui_pref.h"
@@ -24,7 +23,7 @@
 
 static void cb_menu_quit(GtkMenuItem *mi, gpointer data)
 {
-       ui_psensor_quit();
+       ui_psensor_quit((struct ui_psensor *)data);
 }
 
 static void cb_preferences(GtkMenuItem *mi, gpointer data)
@@ -136,8 +135,16 @@ GtkWidget *ui_graph_create(struct ui_psensor * ui)
 
        w_graph = gtk_drawing_area_new();
 
-       g_signal_connect(GTK_WIDGET(w_graph),
-                        "expose-event", G_CALLBACK(on_expose_event), ui);
+       if (GTK_MAJOR_VERSION == 2)
+               g_signal_connect(GTK_WIDGET(w_graph),
+                                "expose-event",
+                                G_CALLBACK(on_expose_event),
+                                ui);
+       else
+               g_signal_connect(GTK_WIDGET(w_graph),
+                                "draw",
+                                G_CALLBACK(on_expose_event),
+                                ui);
 
        gtk_widget_add_events(w_graph, GDK_BUTTON_PRESS_MASK);