#!/usr/bin/perl use strict; use warnings; use FindBin; use lib $FindBin::Bin; use Glib qw( :constants ); use Clutter qw( :init ); use Clutter::Ex::PieSlice; my $stage = Clutter::Stage->get_default(); $stage->set_size(600, 400); $stage->set_color(Clutter::Color->parse('#224444ff')); my $pie_slice = Clutter::Ex::PieSlice->new(); $pie_slice->set_color(Clutter::Color->parse('#ff7700ff')); $pie_slice->set_reactive(TRUE); $pie_slice->set_size(300, 300); $pie_slice->set_anchor_point(150, 150); $pie_slice->set_position(300, 200); $stage->add($pie_slice); $pie_slice->signal_connect(clicked => sub { Clutter->main_quit() }); my $timeline1 = Clutter::Timeline->new(120, 12); $timeline1->set(loop => TRUE); $timeline1->signal_connect('new-frame', sub { $pie_slice->set_proportion($_[1] * 100 / 120); }); $stage->show_all(); $timeline1->start(); Clutter->main(); exit;