]> saetta.ns0.it Git - libgtkmapserver/commitdiff
Show canvas in test.
authorAndrea Zagli <andrea.zagli@email.it>
Tue, 18 Aug 2015 19:15:34 +0000 (21:15 +0200)
committerAndrea Zagli <andrea.zagli@email.it>
Tue, 18 Aug 2015 19:15:34 +0000 (21:15 +0200)
src/gtkmapserver.c
tests/gtkmapserver.c

index 02e740900aa69a96b60511ad524ca8d6f7234ebd..59519d6e5199e9ffb9f9850c66ce49732cf074a5 100644 (file)
@@ -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;
 }
 
index ef4b82fb7ff516a27a119754e6bf2bb9bcc36b89..9b556bbdccc287dc7274a6f8924a482c85ddda68 100644 (file)
@@ -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 ();