]> err.no Git - libchamplain/commitdiff
Make ChamplainViewEmbed create ChamplainView for the user
authorPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Thu, 21 May 2009 22:32:48 +0000 (18:32 -0400)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Fri, 12 Jun 2009 03:55:53 +0000 (23:55 -0400)
champlain-gtk/champlain-view-embed.c
demos/launcher-gtk.c

index e72957092fc4d093ea26cf742aad71e471a5dda8..3e20918353bfde5f44eed8046fe9443b6550fac5 100644 (file)
@@ -158,8 +158,8 @@ champlain_view_embed_init (ChamplainViewEmbed *embed)
   ClutterActor *stage;
 
   ChamplainViewEmbedPrivate *priv = CHAMPLAIN_VIEW_EMBED_GET_PRIVATE (embed);
+  embed->priv = priv;
 
-  priv->view = NULL;
   priv->clutter_embed = gtk_clutter_embed_new ();
 
   g_signal_connect (priv->clutter_embed,
@@ -182,12 +182,13 @@ champlain_view_embed_init (ChamplainViewEmbed *embed)
   priv->cursor_hand_open = gdk_cursor_new(GDK_HAND1);
   priv->cursor_hand_closed = gdk_cursor_new(GDK_FLEUR);
 
+  priv->view = NULL;
+  champlain_view_embed_set_view (embed, champlain_view_new ());
   // Setup stage
   stage = gtk_clutter_embed_get_stage (GTK_CLUTTER_EMBED (priv->clutter_embed));
   clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color);
 
   gtk_container_add (GTK_CONTAINER (embed), priv->clutter_embed);
-  embed->priv = priv;
 }
 
 static void
index d34d8489c519b849e45284a946f55938a9c8de88..545f96bc644ee7fef316f8671906815d01b16644 100644 (file)
@@ -208,8 +208,8 @@ main (int argc,
   vbox = gtk_vbox_new(FALSE, 10);
 
   widget = champlain_view_embed_new ();
-
   view = champlain_view_embed_get_view (CHAMPLAIN_VIEW_EMBED (widget));
+
   g_object_set (G_OBJECT (view), "scroll-mode", CHAMPLAIN_SCROLL_MODE_KINETIC,
       "zoom-level", 5, NULL);
   layer = create_marker_layer (CHAMPLAIN_VIEW (view));