diff options
Diffstat (limited to 'src/MTools')
-rw-r--r-- | src/MTools/Widget/MRadioBouton.pm | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/MTools/Widget/MRadioBouton.pm b/src/MTools/Widget/MRadioBouton.pm index 1dfa1a4..768a00d 100644 --- a/src/MTools/Widget/MRadioBouton.pm +++ b/src/MTools/Widget/MRadioBouton.pm @@ -36,6 +36,7 @@ sub new { bless $self, $class; my $on = $options {g_on}; + my $over = defined $options {g_over} ? $options {g_over} : $on; my $off = $options {g_off}; $self -> recordEvent ('RELEASE'); @@ -44,6 +45,8 @@ sub new { my @gon; push (@gon, $on); + my @gover; + push (@gover, $over); my @goff; push (@goff, $off); @@ -59,17 +62,32 @@ sub new { my $sw = new MTools::MSwitch ( $self, on => \@gon, + over => \@gover, off => \@goff, ); my $st = new MTools::MState ( current_state => 'on', events => { + enter => [$self, '<Enter>'], + leave => [$self, '<Leave>'], press => [$self, '<Button-1>'], press2 => [$self, 'PRESS'], release => [$self, 'RELEASE'], }, transitions => { on => { + enter => { + to => 'over', + }, + press2 => { + to => 'off', + notify => 'PRESSED', + }, + }, + over => { + leave => { + to => 'on', + }, press => { to => 'off', notify => 'PRESSED', |