- button = gtk_button_new_with_label("Hello World");
- g_signal_connect(button, "clicked", G_CALLBACK(print_hello), NULL);
- gtk_window_set_child(GTK_WINDOW(window), button);
+ GtkWidget *box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 1);
+ gtk_container_add(GTK_CONTAINER(window), box);
+
+ struct State *state = (struct State *)user_data;
+ state->voltage = BV_CHART(bv_chart_new());
+ gboolean expand = TRUE;
+ gboolean fill = TRUE;
+ guint padding = 0;
+ gtk_box_pack_start(GTK_BOX(box), GTK_WIDGET(state->voltage), expand, fill,
+ padding);
+
+ state->current = BV_CHART(bv_chart_new());
+ gtk_box_pack_end(GTK_BOX(box), GTK_WIDGET(state->current), expand, fill,
+ padding);
+
+ gtk_widget_show_all(window);
+
+ g_timeout_add_seconds(1, (GSourceFunc)collect_data, user_data);
+}