From 964fb2ee43246d3c0dc879a23c86ff71253fa714 Mon Sep 17 00:00:00 2001 From: Angelo Naselli Date: Thu, 27 Aug 2015 21:25:40 +0200 Subject: Fixed Tab refreshment Added missed comments --- lib/ManaTools/Shared/GUI/ExtTab.pm | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/lib/ManaTools/Shared/GUI/ExtTab.pm b/lib/ManaTools/Shared/GUI/ExtTab.pm index 1e3c91fa..b3f59015 100644 --- a/lib/ManaTools/Shared/GUI/ExtTab.pm +++ b/lib/ManaTools/Shared/GUI/ExtTab.pm @@ -81,7 +81,10 @@ use yui; =head3 INPUT hash ref containing - optfactory: optfactory needed to create a YDumbTab + factory: factory needed to create a widgets + optFactory: optFactory needed to create a YDumbTab + mainw: main dialog/window needed to redraw selected tab + parentWidget: parent widget needed to build the YDumbTab callback: optional parameter to execute a callback @@ -105,6 +108,12 @@ has 'optFactory' => ( required => 1, ); +has 'mainw' => ( + is => 'ro', + isa => 'Maybe[yui::YDialog]', + required => 1, +); + has 'parentWidget' => ( is => 'ro', isa => 'yui::YWidget', @@ -301,12 +310,19 @@ sub findItem { sub buildItem { my $self = shift; my $item = shift; + + # lock windows for multiple changes + $self->mainw->startMultipleChanges(); # clear out replacepoint $self->container->deleteChildren(); # build item's widgetbuilder my $builder = $item->builder(); $builder->($self->factory, $self->optFactory, $self->container, $item->backend()) if (defined $builder); $self->container->showChild(); + # recalulate layout + $self->mainw->recalcLayout(); + # unlock windows for multiple changes + $self->mainw->doneMultipleChanges(); } #============================================================= -- cgit v1.2.1