Help for this page

Select Code to Download


  1. or download this
    my %context;
    
    ...
    $button->bind('<ButtonRelease-1>' => sub{chg_btn(\%context, @_});
    
  2. or download this
    sub sensorHandler {
       my ($context, ...) @_;
    ...
       $context->{sensorOn} = $data !~ /(?<![\w-])OFF(?![\w-])/i;
       ...
    }
    
  3. or download this
    sub chg_btn { 
       my ($context, ...) = @_;
    ...
       $btn1->configure(-background => "green", -foreground => "black") 
          if !$context->{sensorOn};
    }