#!/usr/bin/perl use Gtk2-init; use Gtk2::TrayIcon; use POE::Kernel {loop => "Glib"}; use POE; POE::Session->create( inline_states => { _start => sub { my $icon = $_[HEAP]->{icon} = Gtk2::TrayIcon->new("POE"); my $label = Gtk2::Label->new("POE"); $icon->add($label); $icon->show_all; $icon->send_message(3000, "POE App started"); $_[KERNEL]->delay(wait => 10); }, wait => sub { warn "bye!\n"; }, _stop => sub { warn "stopped\n"; }, } ); $poe_kernel->run();