From: Kaj-Michael Lang Date: Mon, 5 May 2008 20:59:59 +0000 (+0300) Subject: Add zoom-changed signal testing X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c981d9844213c404e8e2c34237bf9d8d86e0a70d;p=mapper Add zoom-changed signal testing --- diff --git a/src/map-widget-test.c b/src/map-widget-test.c index 37a1f45..36d8b3d 100644 --- a/src/map-widget-test.c +++ b/src/map-widget-test.c @@ -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);