#!/usr/bin/perl -w use Gtk; set_locale Gtk; init Gtk; $percent = 0.0; $window = new Gtk::Window('toplevel'); $progress = new Gtk::ProgressBar(); $window->signal_connect( "destroy", sub { Gtk->exit(0); } ); $window->add($progress); $window->show_all; Gtk->timeout_add(500, \&UpdateProgress); main Gtk; sub UpdateProgress { $percent += 0.1; if (1.0 == $percent) { Gtk->exit(0); } $progress->update($percent); }