aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Changes2
-rw-r--r--lib/ManaTools/Shared/GUI/Dialog.pm15
2 files changed, 16 insertions, 1 deletions
diff --git a/Changes b/Changes
index ab0cbd14..16c05190 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,5 @@
+ - Added event_timeout rw attribute to GUI::Dialog to allow
+ manage $yui::YEvent::TimeoutEvent
- Fixed ExtTab to be both EventRole and Event, which means
it captures WidgetEvents for itself and processes
the Events for it's own children as well, the ExtTab
diff --git a/lib/ManaTools/Shared/GUI/Dialog.pm b/lib/ManaTools/Shared/GUI/Dialog.pm
index 45fc151f..428130af 100644
--- a/lib/ManaTools/Shared/GUI/Dialog.pm
+++ b/lib/ManaTools/Shared/GUI/Dialog.pm
@@ -23,6 +23,8 @@ my $dlg = ManaTools::Shared::GUI::Dialog->new(
$ManaTools::Shared::GUI::Dialog::cancelButton,
$ManaTools::Shared::GUI::Dialog::okButton,
],
+ event_timeout => 0, # optional nd rw timeout in msec during the waitForEvent()
+ # needs a ManaTools::Shared::GUI::Event to manage the $yui::YEvent::TimeoutEvent
layout => sub { my $self = shift; my $layoutstart = shift; my $dlg = $self->dialog(); my $info = $self->info(); ... $self->addWidget('button1', $button, sub{...}, $backendItem1); },
restoreValues => sub { my $self = shift; $info = {}; ...; return $info },
result => sub { my $self = shift; ... },
@@ -140,6 +142,17 @@ has 'dialog' => (
},
);
+subtype 'TimeoutType'
+ => as Int
+ => where {($_ >= 0)};
+
+has 'event_timeout' => (
+ is => 'rw',
+ isa => 'TimeoutType',
+ lazy => 1,
+ default => 0,
+);
+
our $mainDialog = 1;
our $popupDialog = 2;
@@ -406,7 +419,7 @@ sub call {
# main loop
while(1) {
- my $yevent = $ydialog->waitForEvent(1000);
+ my $yevent = $ydialog->waitForEvent($self->event_timeout);
last if (!$self->processEvents($yevent));
}