From: Kaj-Michael Lang Date: Tue, 6 May 2008 07:24:42 +0000 (+0300) Subject: Map widget tester: X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=882663d2aae2d559b83013e453ec7457da643d64;p=mapper Map widget tester: - Update zoomer from zoom changed signal --- diff --git a/src/map-widget-test.c b/src/map-widget-test.c index 36d8b3d..d2f1f38 100644 --- a/src/map-widget-test.c +++ b/src/map-widget-test.c @@ -16,9 +16,11 @@ return TRUE; } static void -map_zoom_changed(GtkWidget *widget, gint zoom) +map_zoom_changed(GtkWidget *widget, gint zoom, gpointer data) { -g_debug("New zoom: %d", zoom); +GtkWidget *zoomer=(GtkWidget *)data; + +gtk_range_set_value(GTK_RANGE(zoomer), zoom); return TRUE; } @@ -75,10 +77,10 @@ map=gtk_map_new(); gtk_map_set_tile_repository(map, rd); gtk_box_pack_start(GTK_BOX(hbox), map, TRUE, TRUE, 0); -g_signal_connect(G_OBJECT(map), "zoom-changed", G_CALLBACK(map_zoom_changed), NULL); - zoomer=gtk_vscale_new_with_range(0,17,1); g_signal_connect(G_OBJECT(zoomer), "value-changed", G_CALLBACK(map_zoom), NULL); +g_signal_connect(G_OBJECT(map), "zoom-changed", G_CALLBACK(map_zoom_changed), zoomer); + gtk_box_pack_start(GTK_BOX(hbox), zoomer, FALSE, FALSE, 0); btn_left=gtk_button_new_with_label("L");