]> err.no Git - mapper/commitdiff
Map widget tester:
authorKaj-Michael Lang <milang@tal.org>
Tue, 6 May 2008 07:24:42 +0000 (10:24 +0300)
committerKaj-Michael Lang <milang@tal.org>
Tue, 6 May 2008 07:24:42 +0000 (10:24 +0300)
- Update zoomer from zoom changed signal

src/map-widget-test.c

index 36d8b3de589b3d66684324be1c62383c6c603fd9..d2f1f382ca6681fb32e18a9a2e47495c22db2b98 100644 (file)
@@ -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");