use open ':std', ':utf8';
use Glib qw(TRUE FALSE);
-use Clutter qw(-gtk-init);
-use Gtk2 qw(-init);
+use Clutter qw(-threads-init -init);
use Champlain;
use XML::LibXML;
sub main {
- my $window = Gtk2::Window->new();
- my $vbox = Gtk2::VBox->new(FALSE, 0);
-
-
+ my $stage = Clutter::Stage->get_default();
+ $stage->set_size(800, 600);
+
# Create the map stuff
- my $gtk2_map = Gtk2::ChamplainEmbed->new();
- my $map = $gtk2_map->get_view();
- $gtk2_map->set_size_request(640, 480);
+ my $map = Champlain::View->new();
$map->center_on(0, 0);
$map->set_scroll_mode('kinetic');
$map->set_zoom_level(3);
my $layer = Champlain::Layer->new();
$map->add_layer($layer);
-
-
- my $viewport = Gtk2::Viewport->new();
- $viewport->set_shadow_type('etched-in');
- $viewport->add($gtk2_map);
- $vbox->pack_start($viewport, TRUE, TRUE, 0);
-
- $window->add($vbox);
- $window->set_size_request($gtk2_map->get_size_request);
- $window->signal_connect(destroy => sub {
- Gtk2->main_quit();
- });
- $window->show_all();
+
+ $stage->show_all();
my $capitals_url = "http://en.wikipedia.org/wiki/List_of_national_capitals";
$soup->do_get($capitals_url, \&capitals_main_callback, $data);
- Gtk2->main();
+ Clutter->main();
return 0;
use open ':std', ':utf8';
use Glib qw(TRUE FALSE);
-use Clutter qw(-gtk-init);
-use Gtk2 qw(-init);
+use Clutter qw(-threads-init -init);
use Champlain;
use XML::LibXML;
use Carp;
local $| = 1;
- my $window = Gtk2::Window->new();
- $window->set_border_width(10);
- $window->set_title("Champlain + Flickr - Demo");
- $window->signal_connect('destroy' => sub { Gtk2->main_quit() });
-
- my $vbox = Gtk2::VBox->new(FALSE, 10);
+ my $stage = Clutter::Stage->get_default();
+ $stage->set_size(800, 600);
# Create the map view
- my $gtk2_map = Gtk2::ChamplainEmbed->new();
- my $map = $gtk2_map->get_view();
+ my $map = Champlain::View->new();
$map->center_on(47.130885, -70.764141);
$map->set_scroll_mode('kinetic');
$map->set_zoom_level(5);
- $gtk2_map->set_size_request(640, 480);
+ $map->set_size(640, 480);
# Create the markers and marker layer
my $layer = Champlain::Layer->new();
$layer->show();
$map->add_layer($layer);
-
+
$LABEL = make_label();
$LABEL->hide();
$map->add($LABEL);
- my $viewport = Gtk2::Viewport->new();
- $viewport->set_shadow_type('etched-in');
- $viewport->add($gtk2_map);
-
- $vbox->add($viewport);
-
- $window->add($vbox);
- $window->show_all();
+ $stage->show_all();
my $icon = Clutter::Texture->new(
File::Spec->catfile($FindBin::Bin, 'images', 'flickr.png')
};
$map->signal_connect_after("button-release-event", \&flickr_search, $data);
- Gtk2->main();
+ Clutter->main();
return 0;
}
sub make_label {
my $black = Clutter::Color->new(0x00, 0x00, 0x00, 0xff);
- my $button_text = Clutter::Label->new("Sans 16", '', $black);
+ my $button_text = Clutter::Text->new("Sans 16", '', $black);
$button_text->set_position(10, 10);
return $button_text;
use warnings;
use Glib qw(TRUE FALSE);
-use Clutter qw(-gtk-init);
+use Clutter qw(-threads-init -init);
use Gtk2 qw(-init);
use Champlain;
use LWP::UserAgent;
exit main();
sub main {
-
- my $window = Gtk2::Window->new();
- $window->set_border_width(10);
- $window->set_title("Champlain - Demo");
- $window->signal_connect('destroy' => sub { Gtk2->main_quit() });
-
- my $vbox = Gtk2::VBox->new(FALSE, 10);
+
+ my $stage = Clutter::Stage->get_default();
+ $stage->set_size(800, 600);
# Create the map view
- my $gtk2_map = Gtk2::ChamplainEmbed->new();
- my $map = $gtk2_map->get_view();
+ my $map = Champlain::View->new();
$map->center_on(47.130885, -70.764141);
$map->set_scroll_mode('kinetic');
$map->set_zoom_level(5);
- $gtk2_map->set_size_request(640, 480);
-
+
# Create the markers and marker layer
my $layer = create_marker_layer($map);
$map->add_layer($layer);
-
- my $viewport = Gtk2::Viewport->new();
- $viewport->set_shadow_type('etched-in');
- $viewport->add($gtk2_map);
-
- $vbox->add($viewport);
-
- $window->add($vbox);
- $window->show_all();
-
- Gtk2->main();
-
+
+ $stage->show_all();
+
+ Clutter->main();
+
return 0;
}