diff options
Diffstat (limited to 'src/MTools/GUI')
-rw-r--r-- | src/MTools/GUI/MClip.pm | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/src/MTools/GUI/MClip.pm b/src/MTools/GUI/MClip.pm index bc8405d..cf4f850 100644 --- a/src/MTools/GUI/MClip.pm +++ b/src/MTools/GUI/MClip.pm @@ -34,55 +34,55 @@ BEGIN } sub new { - my ($class, $clipped, $path, $debug) = @_; - my $self = new MTools::MObjet (); - bless $self, $class; - - $self -> recordProperty ('-visible', 1); - $self -> plisten ('-visible', sub { - my ($src, $key, $val) = @_; - if ($val == 0) - { - mconfigure($self->{__clipped}, -clip => undef); - } - else - { - mconfigure($self->{__clipped}, -clip => $self->{__clip}); - } - }); - - if (!defined $debug) {$debug = 0} - - my $clip = $path; - if(ref ($path) eq 'ARRAY') - { - my $type = shift @{$path}; - $clip = $zinc -> add ($type, $clipped -> {instance}, $path, - -filled => 1, - -priority => 10, - -linewidth => 0, - -fillcolor => "#000000", - -visible => $debug, - -sensitive => 0, - ); - } - elsif(ref ($path) eq '') - { - $clip = minstance ($clip, $clipped); - MTools::chggroup ($clip, $clipped); - MTools::mconfigure ($clip, -visible => $debug, -sensitive => 0); - } - else - { - MTools::chggroup ($clip, $clipped); - MTools::mconfigure (-visible => $debug, -sensitive => 0); - $clip = minstance ($clip); - } + my ($class, $clipped, $path, $debug) = @_; + my $self = new MTools::MObjet (); + bless $self, $class; + + if (!defined $debug) {$debug = 0} + + my $clip = $path; + if(ref ($path) eq 'ARRAY') + { + my $type = shift @{$path}; + $clip = $zinc -> add ($type, $clipped -> {instance}, $path, + -filled => 1, + -priority => 10, + -linewidth => 0, + -fillcolor => "#000000", + -visible => $debug, + -sensitive => 0, + ); + } + elsif(ref ($path) eq '') + { + $clip = minstance ($clip, $clipped); + MTools::chggroup ($clip, $clipped); + MTools::mconfigure ($clip, -visible => $debug, -sensitive => 0); + } + else + { + MTools::chggroup ($clip, $clipped); + MTools::mconfigure ($clip, -visible => $debug, -sensitive => 0); + $clip = minstance ($clip); + } $self -> {__clipped} = $clipped; $self -> {__clip} = $clip; mconfigure ($clipped, -clip => $clip); + + $self -> recordProperty ('-visible', 1); + $self -> plisten ('-visible', sub { + my ($src, $key, $val) = @_; + if ($val == 0) + { + mconfigure($self->{__clipped}, -clip => undef); + } + else + { + mconfigure($self->{__clipped}, -clip => $self->{__clip}); + } + }); return $self; -} + } sub translate { my ($self, @args) = @_; |