From: wellu Date: Thu, 4 Sep 2008 18:54:04 +0000 (+0000) Subject: Minor fixes. X-Git-Tag: 0.99~43 X-Git-Url: http://git.maemo.org/git/?p=speedometer;a=commitdiff_plain;h=af5b97b87d2867b9d9dd34cda5153ea1f652eaad Minor fixes. git-svn-id: file:///svnroot/speedometer/trunk@16 df364472-da61-43ef-8a67-511c89aa921b --- diff --git a/Makefile b/Makefile index 0650c32..c8c82dc 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ CC = gcc LINK = gcc -CFLAGS = -g -Wall +CFLAGS = -g -Wall -O0 INCPATH = `pkg-config --cflags gtk+-2.0 liblocation` LIBS = `pkg-config --libs gtk+-2.0 liblocation` diff --git a/callbacks.c b/callbacks.c index 7ba4ce9..620bfd4 100644 --- a/callbacks.c +++ b/callbacks.c @@ -18,7 +18,8 @@ #include "callbacks.h" -static void print_stuff(LocationGPSDevice* device) { +// this is just here for debugging and tracing purposes +static void print_location(LocationGPSDevice* device) { g_print("Latitude: %.2f\n" "Longitude: %.2f\n" "Altitude: %.2f\n" @@ -30,6 +31,7 @@ static void print_stuff(LocationGPSDevice* device) { } void location_changed(LocationGPSDevice* device, gpointer userdata) { + } gboolean key_press_cb(GtkWidget* widget, GdkEventKey* event, HildonWindow* window) { diff --git a/main.c b/main.c index a3c6de0..ad2454f 100644 --- a/main.c +++ b/main.c @@ -33,7 +33,8 @@ int main(int argc, char** argv) { gtk_init(&argc, &argv); - GtkWidget *i1, *i2, *i3; + GtkImage* table[10]; // stores the images + GtkWidget *box; program = HILDON_PROGRAM(hildon_program_get_instance()); @@ -42,14 +43,23 @@ int main(int argc, char** argv) { window = HILDON_WINDOW(hildon_window_new()); hildon_program_add_window(program, window); - i1 = gtk_image_new_from_file("data/1.png"); - i2 = gtk_image_new_from_file("data/3.png"); - i3 = gtk_image_new_from_file("data/4.png"); + + 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_end(box, i1, FALSE, FALSE, 0); - gtk_box_pack_end(box, i2, FALSE, FALSE, 0); - gtk_box_pack_end(box, i3, FALSE, FALSE, 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));