From a7bd2b66c38b625a50ab8bf85e8d8ea0be78ac8f Mon Sep 17 00:00:00 2001 From: caramel Date: Fri, 14 Sep 2007 13:59:23 +0000 Subject: Modifications sur le MToggleBouton (methode changeCurrentState) + MRadioButton (bugs dus au svg occasionnant des boucles infinies --- src/MTools/Widget/MRadioBouton.pm | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'src/MTools/Widget/MRadioBouton.pm') diff --git a/src/MTools/Widget/MRadioBouton.pm b/src/MTools/Widget/MRadioBouton.pm index 768a00d..3491235 100644 --- a/src/MTools/Widget/MRadioBouton.pm +++ b/src/MTools/Widget/MRadioBouton.pm @@ -59,9 +59,15 @@ sub new { plink ([$self, 'text'], [$txt, '-text']); } $self -> mconfigure (-atomic => 1); + + my $timer = new MTools::MTimer (5, 1); + my @gon_tmp = @gon; + push (@gon_tmp, $timer); + my $sw = new MTools::MSwitch ( $self, on => \@gon, + on_tmp => \@gon_tmp, over => \@gover, off => \@goff, ); @@ -73,20 +79,38 @@ sub new { press => [$self, ''], press2 => [$self, 'PRESS'], release => [$self, 'RELEASE'], + timeout => [$timer, 'TIME_OUT'], }, transitions => { on => { enter => { to => 'over', }, + press => { + to => 'off', + notify => 'PRESSED', + }, + press2 => { + to => 'off', + notify => 'PRESSED', + }, + }, + on_tmp => { + press => { + to => 'off', + notify => 'PRESSED', + }, press2 => { to => 'off', notify => 'PRESSED', }, + timeout => { + to => 'on', + }, }, over => { leave => { - to => 'on', + to => 'on_tmp', }, press => { to => 'off', -- cgit v1.1