]> err.no Git - mapper/commitdiff
Add zoom-changed signal testing
authorKaj-Michael Lang <milang@tal.org>
Mon, 5 May 2008 20:59:59 +0000 (23:59 +0300)
committerKaj-Michael Lang <milang@tal.org>
Mon, 5 May 2008 20:59:59 +0000 (23:59 +0300)
src/map-widget-test.c

index 37a1f45721b42056b787d224973c176f59919c87..36d8b3de589b3d66684324be1c62383c6c603fd9 100644 (file)
@@ -15,6 +15,13 @@ gtk_map_set_zoom(map, (gint)gtk_range_get_value(widget));
 return TRUE;
 }
 
+static void
+map_zoom_changed(GtkWidget *widget, gint zoom)
+{
+g_debug("New zoom: %d", zoom);
+return TRUE;
+}
+
 static gboolean
 map_pan_up(GtkWidget *widget, gpointer data)
 {
@@ -58,6 +65,7 @@ rd->cache_dir=TESTREPO;
 
 dialog=GTK_DIALOG(gtk_dialog_new ());
 gtk_window_set_title(GTK_WINDOW(dialog), "Map test");
+gtk_window_resize(GTK_WINDOW(dialog), 800, 600);
 gtk_dialog_add_button (dialog, "Close", GTK_RESPONSE_CLOSE);
 
 hbox=gtk_hbox_new(FALSE, 3);
@@ -67,6 +75,8 @@ 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);
 gtk_box_pack_start(GTK_BOX(hbox), zoomer, FALSE, FALSE, 0);