From: Kaj-Michael Lang Date: Tue, 5 Aug 2008 12:55:03 +0000 (+0300) Subject: MapWidget: Init threads properly in test app, set initial zoom X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd930ad1604995a84e8440a835a2acf77e6b7ed3;p=mapper MapWidget: Init threads properly in test app, set initial zoom --- diff --git a/libs/libgtkmap/map-widget-test.c b/libs/libgtkmap/map-widget-test.c index 6eb241f..08c6f08 100644 --- a/libs/libgtkmap/map-widget-test.c +++ b/libs/libgtkmap/map-widget-test.c @@ -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; }