From cd930ad1604995a84e8440a835a2acf77e6b7ed3 Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Tue, 5 Aug 2008 15:55:03 +0300 Subject: [PATCH] MapWidget: Init threads properly in test app, set initial zoom --- libs/libgtkmap/map-widget-test.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) 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; } -- 2.39.5