From 138a40048107e5aac97b61201c801091bc559aa0 Mon Sep 17 00:00:00 2001 From: Angelo Naselli Date: Tue, 5 May 2015 16:42:30 +0200 Subject: Set icon and title into Module base class, to avoid doing that for any modules --- lib/ManaTools/Module.pm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/lib/ManaTools/Module.pm b/lib/ManaTools/Module.pm index 678b6a9..2288700 100644 --- a/lib/ManaTools/Module.pm +++ b/lib/ManaTools/Module.pm @@ -179,7 +179,30 @@ sub create { return $obj; } +#============================================================= + +=head2 BUILD + +=head3 INPUT + + $self: this object + +=head3 DESCRIPTION + The BUILD method is called after a Moose object is created, + base Module class sets title and icon + +=cut + +#============================================================= +sub BUILD { + my $self = shift; + + ## set title + yui::YUI::app()->setApplicationTitle($self->name) if $self->name; + ## set icon + yui::YUI::app()->setApplicationIcon($self->icon) if $self->icon; +} #============================================================= -- cgit v1.2.1