Alpha release.
[speedometer] / ui.c
diff --git a/ui.c b/ui.c
index ea70e28..d582f5b 100644 (file)
--- a/ui.c
+++ b/ui.c
@@ -54,6 +54,15 @@ void reset_speed(AppData* appdata) {
        appdata->speed_array[2] = (GtkImage*) gtk_image_new_from_pixbuf(zero);
 }
 
+void set_nth_digit(AppData* appdata, guint n, guint value) {
+       //assert(nth >= 0 && nth < 3);
+
+       GtkImage* image = appdata->speed_array[n];
+       GdkPixbuf* buf = gtk_image_get_pixbuf(appdata->image_array[value]);
+       gtk_image_set_from_pixbuf(image, buf);
+       gtk_widget_queue_draw(GTK_WIDGET(appdata->speed_array[n]));
+}
+
 guint randomize(AppData* appdata) {
 
        gint32 n = g_random_int_range(0, 3);