From: Pierre-Luc Beaudoin Date: Thu, 21 May 2009 22:32:48 +0000 (-0400) Subject: Make ChamplainViewEmbed create ChamplainView for the user X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b788d50d8c433efdf62add4137003de3d16e7385;p=libchamplain Make ChamplainViewEmbed create ChamplainView for the user --- diff --git a/champlain-gtk/champlain-view-embed.c b/champlain-gtk/champlain-view-embed.c index e729570..3e20918 100644 --- a/champlain-gtk/champlain-view-embed.c +++ b/champlain-gtk/champlain-view-embed.c @@ -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 diff --git a/demos/launcher-gtk.c b/demos/launcher-gtk.c index d34d848..545f96b 100644 --- a/demos/launcher-gtk.c +++ b/demos/launcher-gtk.c @@ -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));