From: Andrea Zagli Date: Tue, 18 Aug 2015 19:15:34 +0000 (+0200) Subject: Show canvas in test. X-Git-Tag: v0.0.1~13 X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=d42fddb2f6bc3b19a9074a1b653e52ea454cdd5d;p=libgtkmapserver Show canvas in test. --- diff --git a/src/gtkmapserver.c b/src/gtkmapserver.c index 02e7409..59519d6 100644 --- a/src/gtkmapserver.c +++ b/src/gtkmapserver.c @@ -51,6 +51,7 @@ static void gtk_mapserver_get_property (GObject *object, typedef struct _GtkMapserverPrivate GtkMapserverPrivate; struct _GtkMapserverPrivate { + gpointer nothing; }; G_DEFINE_TYPE (GtkMapserver, gtk_mapserver, GOO_TYPE_CANVAS) @@ -133,6 +134,17 @@ GtkWidget g_free (localedir); + g_object_set (G_OBJECT (gtk_mapserver), + "background-color", "white", + NULL); + + GooCanvasItem *root = goo_canvas_get_root_item (GOO_CANVAS (gtk_mapserver)); + + /* Add a few simple items. */ + goo_canvas_path_new (root, + "M 100 100 L 500 100 L 500 500 L 100 500 z", + NULL); + return gtk_mapserver; } diff --git a/tests/gtkmapserver.c b/tests/gtkmapserver.c index ef4b82f..9b556bb 100644 --- a/tests/gtkmapserver.c +++ b/tests/gtkmapserver.c @@ -42,11 +42,15 @@ main (int argc, char **argv) /* Create the window and widgets. */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 640, 600); - gtk_widget_show (window); g_signal_connect (window, "delete_event", G_CALLBACK (on_delete_event), NULL); + gtkmap = gtk_mapserver_new (); + gtk_container_add (GTK_CONTAINER (window), gtkmap); + + gtk_widget_show_all (window); + /* Pass control to the GTK+ main event loop. */ gtk_main ();