diff options
Diffstat (limited to 'remote_plot.c')
-rw-r--r-- | remote_plot.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/remote_plot.c b/remote_plot.c index 8f89e62..b41e2c6 100644 --- a/remote_plot.c +++ b/remote_plot.c @@ -309,9 +309,17 @@ static void draw_function (GtkDrawingArea *area, //printf("draw done\n"); } -static void print_hello (GtkWidget *widget, gpointer user_data) +static void print_data (GtkWidget *widget, gpointer user_data) { - g_print ("Hello World\n"); + DATA *data=user_data; + printf("t:"); + for(int i=0;i<10;i++) + printf(" %g",data->t[i]); + printf("\n"); + printf("buffer:"); + for(int i=0;i<10;i++) + printf(" %g",data->buffer[i]); + printf("\n"); } static void activate (GtkApplication *app, gpointer user_data) @@ -332,8 +340,8 @@ static void activate (GtkApplication *app, gpointer user_data) draw_function, user_data, NULL); - button = gtk_button_new_with_label ("Hello World"); - g_signal_connect (button, "clicked", G_CALLBACK (print_hello), NULL); + button = gtk_button_new_with_label ("Print data"); + g_signal_connect (button, "clicked", G_CALLBACK (print_data), user_data); gtk_box_append(GTK_BOX(box), button); gtk_box_append(GTK_BOX(box), data->area); |