]> err.no Git - mapper/commitdiff
MapWidget: Init threads properly in test app, set initial zoom
authorKaj-Michael Lang <milang@tal.org>
Tue, 5 Aug 2008 12:55:03 +0000 (15:55 +0300)
committerKaj-Michael Lang <milang@tal.org>
Tue, 5 Aug 2008 12:55:03 +0000 (15:55 +0300)
libs/libgtkmap/map-widget-test.c

index 6eb241f48007dfd36c2b313ceb075107aa3f3075..08c6f088709884362fdf2ba7e744be4f4083f9e7 100644 (file)
@@ -6,8 +6,6 @@
 
 #define TESTREPO "/home/milang/MyDocs/.documents/Maps/OpenStreet"
 
-#define WITH_THREADS 1
-
 GtkWidget *map;
 
 static gboolean
@@ -69,13 +67,9 @@ GtkWidget *hbox, *zoomer, *btn_left, *btn_right, *btn_up, *btn_down, *vbox;
 GtkWidget *rotate;
 RepoData *rd;
 
-#if WITH_THREADS
-if (!g_thread_supported ()) {
-       g_thread_init(NULL);
-}
+g_thread_init(NULL);
+g_type_init();
 gdk_threads_init();
-gdk_threads_enter();
-#endif
 
 gtk_init(&argc, &args);
 
@@ -130,13 +124,12 @@ g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(gtk_main_quit), NULL);
 gtk_widget_show_all(GTK_WIDGET(window));
 
 gtk_map_set_center_latlon(map, 60.45, 22.25);
+gtk_range_set_value(GTK_RANGE(zoomer), 8);
 gtk_map_set_zoom(map, 8);
 
+gdk_threads_enter();
 gtk_main();
-
-#ifdef WITH_THREADS
 gdk_threads_leave();
-#endif
     
 return 0;
 }