diff options
author | Xiao Pan <xyz@flylightning.xyz> | 2025-04-30 02:11:06 -0700 |
---|---|---|
committer | Xiao Pan <xyz@flylightning.xyz> | 2025-04-30 02:11:06 -0700 |
commit | bb61fdf4f9644eb6bbe1152504a224b8b6232501 (patch) | |
tree | a149f39d4f1e64d32f7ebc3ea793a8b60d5000f2 | |
parent | 8a3739a78623be0434da75e890ea07d54fd3f208 (diff) |
update drawing area if toggle live
-rw-r--r-- | remote_plot.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/remote_plot.c b/remote_plot.c index ae50612..5e3a1dc 100644 --- a/remote_plot.c +++ b/remote_plot.c @@ -606,6 +606,12 @@ static void set_to_time (GtkWidget *widget, gpointer user_data) gtk_widget_queue_draw(data->area); } +static void update_drawing_area (GtkWidget *widget, gpointer user_data) +{ + DATA *data=user_data; + gtk_widget_queue_draw(data->area); +} + static void activate (GtkApplication *app, gpointer user_data) { DATA *data=user_data; @@ -641,6 +647,7 @@ static void activate (GtkApplication *app, gpointer user_data) data->temp_label=gtk_label_new("Average temperature:"); data->live_toggle = gtk_toggle_button_new_with_label("Live"); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(data->live_toggle),TRUE); + g_signal_connect (data->live_toggle, "toggled", G_CALLBACK (update_drawing_area), user_data); for(int i=0;i<(VOLTLEN+TEMPLEN);i++) data->checkbutton[i]=gtk_check_button_new_with_label(checkbutton_names[i]); |