From 882663d2aae2d559b83013e453ec7457da643d64 Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Tue, 6 May 2008 10:24:42 +0300 Subject: [PATCH] Map widget tester: - Update zoomer from zoom changed signal --- src/map-widget-test.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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"); -- 2.39.5