| [reply] [d/l] [select] |
Here is an example of how to manipulate an overrideredirect window, it does a drag, but you can use similar techniques, something like a shift-key binding, to minimize/maximize the window.
#!/usr/bin/perl
use warnings;
use strict;
use Tk;
my $top = MainWindow->new;
$top->geometry('200x200+200+200');
$top->overrideredirect(1);
$top->Label( -text => 'Click and Drag' )->pack(
-expand => 1,
-fill => 'both'
);
$top->Button(
-text => 'Exit',
-command => sub { $top->destroy }
)->pack;
my @deltaxy;
$top->bind( '<1>' => \&getdelta );
$top->bind( '<B1-Motion>' => \&mousemove );
MainLoop;
sub mousemove {
my ( $width, $height, $x, $y ) = split /[+x]/, $top->geometry;
$x = $top->pointerx - $deltaxy[0];
$y = $top->pointery - $deltaxy[1];
$top->geometry( $width . 'x' . $height . "+$x+$y" );
}
sub getdelta {
@deltaxy = ( $top->pointerx - $top->x, $top->pointery - $top->y );
}
| [reply] [d/l] |
Thanks you, i know that but i dont know how to add the max/min function any suggestion ?
| [reply] |
| [reply] |