Minor fixes.
[speedometer] / main.c
diff --git a/main.c b/main.c
index e2bfcc6..ad2454f 100644 (file)
--- a/main.c
+++ b/main.c
@@ -33,48 +33,75 @@ int main(int argc, char** argv) {
 
        gtk_init(&argc, &argv);
 
+       GtkImage* table[10]; // stores the images
+
+       GtkWidget *box;
 
        program = HILDON_PROGRAM(hildon_program_get_instance());
        g_set_application_name("Speedometer");
 
-       /* Create HildonWindow and set it to HildonProgram */
        window = HILDON_WINDOW(hildon_window_new());
        hildon_program_add_window(program, window);
 
 
+       int i = 0;
+       while(i < 10) {
+               char* path = malloc(30);
+               g_sprintf(path, "data/%d.png", i);
+               table[i] = gtk_image_new_from_file(path);
+               g_print(path);
+               g_print("\n");
+               free(path);
+               i++;
+       }
+
+       box = gtk_hbox_new(TRUE, 0);
+
+       gtk_box_pack_start(box, table[6], FALSE, FALSE, 0);
+       gtk_box_pack_start(box, table[5], FALSE, FALSE, 0);
+       gtk_box_pack_start(box, table[8], FALSE, FALSE, 0);
+
+       gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(box));
+
+       // set the background color to black
+       GdkColor black;
+       black.red = 0x0000;
+       black.blue = 0x0000;
+       black.green = 0x0000;
+       gtk_widget_modify_bg(window, GTK_STATE_NORMAL, &black);
+
+       // set the window fullscreen
+       gtk_window_fullscreen(GTK_WINDOW(window));
 
-       /* Show all widgets that are contained by the window. */
        gtk_widget_show_all(GTK_WIDGET(window));
 
 
 
        g_thread_init(NULL);
 
+
+#ifdef __arm__
        // gps device
        LocationGPSDevice *device;
-       device = g_object_new (LOCATION_TYPE_GPS_DEVICE, NULL);
-
+       device = g_object_new(LOCATION_TYPE_GPS_DEVICE, NULL);
 
        // connect some signal handlers
        g_signal_connect (device, "changed", G_CALLBACK (location_changed), NULL);
 
-       /* Connect signal to X in the upper corner */
-       g_signal_connect(G_OBJECT(window), "delete_event", G_CALLBACK(gtk_main_quit), NULL);
-
     g_signal_connect(G_OBJECT(window),  "key_press_event", G_CALLBACK(key_press_cb), window);
 
        LocationGPSDControl *control;
 
        control = location_gpsd_control_get_default();
        location_gpsd_control_start(control);
+#endif // __arm__
 
-
+       /* Connect signal to X in the upper corner */
+       g_signal_connect(G_OBJECT(window), "delete_event", G_CALLBACK(gtk_main_quit), NULL);
 
        /* Start the main event loop. */
        gtk_main();
 
-
-
        return EXIT_SUCCESS;
 }