[libchamplain: 23/39] Make sure that the view has a size and that it is added to the stage
- From: Pierre-Luc Beaudoin <plbeaudoin src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [libchamplain: 23/39] Make sure that the view has a size and that it is added to the stage
- Date: Mon, 21 Sep 2009 16:25:39 +0000 (UTC)
commit 74566398392ec9f62c7bab0979b01d9486edfdf4
Author: Emmanuel Rodriguez <emmanuel rodriguez gmail com>
Date: Thu Sep 17 21:40:35 2009 +0200
Make sure that the view has a size and that it is added to the stage
bindings/perl/Champlain/examples/capitals.pl | 8 +++++---
bindings/perl/Champlain/examples/flickr.pl | 1 +
bindings/perl/Champlain/examples/image.pl | 2 ++
bindings/perl/Champlain/examples/launcher.pl | 2 +-
4 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/bindings/perl/Champlain/examples/capitals.pl b/bindings/perl/Champlain/examples/capitals.pl
index 8ab6da0..34bd503 100755
--- a/bindings/perl/Champlain/examples/capitals.pl
+++ b/bindings/perl/Champlain/examples/capitals.pl
@@ -32,10 +32,12 @@ sub main {
# Create the map stuff
my $map = Champlain::View->new();
+ $map->set_size($stage->get_size);
$map->center_on(0, 0);
$map->set_scroll_mode('kinetic');
$map->set_zoom_level(3);
-
+ $stage->add($map);
+
my $layer = Champlain::Layer->new();
$map->add_layer($layer);
@@ -46,8 +48,8 @@ sub main {
my $soup = My::Soup->new($capitals_url);
my $data = {
- map => $map,
- layer => $layer,
+ map => $map,
+ layer => $layer,
markers => [],
};
diff --git a/bindings/perl/Champlain/examples/flickr.pl b/bindings/perl/Champlain/examples/flickr.pl
index 6e82229..983dd3e 100755
--- a/bindings/perl/Champlain/examples/flickr.pl
+++ b/bindings/perl/Champlain/examples/flickr.pl
@@ -53,6 +53,7 @@ sub main {
$map->set_scroll_mode('kinetic');
$map->set_zoom_level(5);
$map->set_size(640, 480);
+ $stage->add($map);
# Create the markers and marker layer
my $layer = Champlain::Layer->new();
diff --git a/bindings/perl/Champlain/examples/image.pl b/bindings/perl/Champlain/examples/image.pl
index 0f85120..3d1fde8 100755
--- a/bindings/perl/Champlain/examples/image.pl
+++ b/bindings/perl/Champlain/examples/image.pl
@@ -29,9 +29,11 @@ sub main {
# Create the map view
my $map = Champlain::View->new();
+ $map->set_size($stage->get_size);
$map->center_on(47.130885, -70.764141);
$map->set_scroll_mode('kinetic');
$map->set_zoom_level(5);
+ $stage->add($map);
# Create the markers and marker layer
my $layer = create_marker_layer($map);
diff --git a/bindings/perl/Champlain/examples/launcher.pl b/bindings/perl/Champlain/examples/launcher.pl
index fbe718c..1018c44 100755
--- a/bindings/perl/Champlain/examples/launcher.pl
+++ b/bindings/perl/Champlain/examples/launcher.pl
@@ -24,7 +24,7 @@ sub main {
# Create the map view
my $map = Champlain::View->new();
$map->set_scroll_mode('kinetic');
- $map->set_size(800, 600);
+ $map->set_size($stage->get_size);
$stage->add($map);
# Create the zoom buttons
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]