2 * Copyright (C) 2010-2014 jeanfi@gmail.com
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 on_graph_clicked(GtkWidget *widget, GdkEventButton *event, gpointer data)
25 if (event->type != GDK_BUTTON_PRESS)
28 gtk_menu_popup(GTK_MENU(((struct ui_psensor *)data)->popup_menu),
29 NULL, NULL, NULL, NULL,
30 event->button, event->time);
36 on_expose_event(GtkWidget *widget, GdkEventExpose *event, gpointer data)
38 struct ui_psensor *ui_psensor = (struct ui_psensor *)data;
40 graph_update(ui_psensor->sensors,
43 ui_psensor->main_window);
48 void smooth_curves_enabled_changed_cbk(void *data)
50 is_smooth_curves_enabled = config_is_smooth_curves_enabled();
53 void ui_graph_create(struct ui_psensor *ui)
57 log_debug("ui_graph_create()");
59 w_graph = ui->w_graph;
61 is_smooth_curves_enabled = config_is_smooth_curves_enabled();
62 g_signal_connect_after(config_get_GSettings(),
63 "changed::graph-smooth-curves-enabled",
64 G_CALLBACK(smooth_curves_enabled_changed_cbk),
67 g_signal_connect(GTK_WIDGET(w_graph),
69 G_CALLBACK(on_expose_event),
72 gtk_widget_add_events(w_graph, GDK_BUTTON_PRESS_MASK);
74 g_signal_connect(GTK_WIDGET(w_graph),
76 (GCallback) on_graph_clicked, ui);
78 log_debug("ui_graph_create() ends");