From 56ba10cca0693a7da305e5a415f788e25aa44a64 Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Sat, 17 May 2008 18:57:25 +0300 Subject: [PATCH] MapWidget: - Add rotate testing to widget test application --- src/map-widget-test.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/map-widget-test.c b/src/map-widget-test.c index 9d02ccb..0f7725f 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 gboolean +map_rotate(GtkWidget *widget, gpointer data) +{ +gtk_map_rotate(map, gtk_range_get_value(widget)); +return TRUE; +} + static void map_zoom_changed(GtkWidget *widget, gint zoom, gpointer data) { @@ -57,6 +64,7 @@ main (int argc, char **args) { GtkDialog *dialog; GtkWidget *hbox, *zoomer, *btn_left, *btn_right, *btn_up, *btn_down, *vbox; +GtkWidget *rotate; RepoData *rd; gtk_init (&argc, &args); @@ -81,6 +89,8 @@ gtk_box_pack_start(GTK_BOX(hbox), map, TRUE, TRUE, 0); zoomer=gtk_vscale_new_with_range(0,17,1); gtk_box_pack_start(GTK_BOX(hbox), zoomer, FALSE, FALSE, 0); +rotate=gtk_hscale_new_with_range(0,360,1); + btn_left=gtk_button_new_with_label("L"); btn_right=gtk_button_new_with_label("R"); btn_up=gtk_button_new_with_label("U"); @@ -93,8 +103,10 @@ gtk_box_pack_start(GTK_BOX(vbox), btn_down, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(dialog->vbox), hbox, TRUE, TRUE, 0); +gtk_box_pack_start(GTK_BOX(dialog->vbox), rotate, FALSE, FALSE, 0); g_signal_connect(G_OBJECT(zoomer), "value-changed", G_CALLBACK(map_zoom), NULL); +g_signal_connect(G_OBJECT(rotate), "value-changed", G_CALLBACK(map_rotate), NULL); g_signal_connect(G_OBJECT(map), "zoom-changed", G_CALLBACK(map_zoom_changed), zoomer); g_signal_connect(G_OBJECT(btn_up), "clicked", G_CALLBACK(map_pan_up), NULL); -- 2.39.5