[libchamplain: 30/39] Fix a clutter warning when cloning the default icon for pending flickr images.



commit 52b7ab2aa88f90a2c34d23232ac868eec6ea7225
Author: Emmanuel Rodriguez <emmanuel rodriguez gmail com>
Date:   Fri Sep 18 14:11:50 2009 +0200

    Fix a clutter warning when cloning the default icon for pending flickr images.
    
    In Clutter 1.0 an actor can only be cloned if it's in the stage. It doesn't have
    to be visible, just in the stage.

 bindings/perl/Champlain/examples/flickr.pl |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/bindings/perl/Champlain/examples/flickr.pl b/bindings/perl/Champlain/examples/flickr.pl
index 72997db..dd7944d 100755
--- a/bindings/perl/Champlain/examples/flickr.pl
+++ b/bindings/perl/Champlain/examples/flickr.pl
@@ -14,7 +14,7 @@ Where I<key> is a valid Flickr key.
 
 This sample scripts shows how to interact with the Flickr API and to display
 thumbnails for pictures near a location. The Flickr API interaction is triggered
-when a middle-click in done in a location  on the map.
+when a middle-click in done in a location on the map.
 
 =cut
 
@@ -67,9 +67,21 @@ sub main {
 
 	$stage->show_all();
 
+
+	#
+	# This is the default icon that will be displayed while the flickr a image
+	# is being downloaded. This exact actor ($icon) will never be displayed,
+	# instead copies of it (clones) will be displayed.
+	#
+	# Since clutter 1.0 an actor can only be cloned if it is added to the stage.
+	# It doesn't need to be visible, just to be in the stage.
+	#
 	my $icon = Clutter::Texture->new(
 		File::Spec->catfile($FindBin::Bin, 'images', 'flickr.png')
 	);
+	$stage->add($icon);
+	$icon->hide();
+
 
 	# Middle click on a location to trigger the Flickr interaction
 	$map->set_reactive(TRUE);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]