]> git.scottworley.com Git - batteryviewer/blobdiff - batteryviewer.c
Call collect_data() regularly
[batteryviewer] / batteryviewer.c
index a525a729b56ca9cdee6002a67b5f8142fd6caae5..65d70091b118606d32376ebd92c7472b698dcbe6 100644 (file)
@@ -6,6 +6,10 @@ struct State {
   BVChart *current;
 };
 
+static gboolean collect_data(struct State *state __attribute__((unused))) {
+  return TRUE;
+}
+
 static void activate(GtkApplication *app, gpointer user_data) {
 
   GtkWidget *window = gtk_application_window_new(app);
@@ -33,6 +37,8 @@ static void activate(GtkApplication *app, gpointer user_data) {
                    padding);
 
   gtk_widget_show_all(window);
+
+  g_timeout_add_seconds(1, (GSourceFunc)collect_data, user_data);
 }
 
 int main(int argc, char **argv) {