in reply to Follow the window?
You can also use negative numbers to specify start from the lower right corner.
$mw->geometry('100x100-0-0');
Here is a useful sub to center a window on any screen, as it automatically detects monitor size.
sub CenterWindow { my($window, $width, $height) = @_; $window->idletasks; $width = $window->reqwidth unless $width; $height = $window->reqheight unless $height; my $x = int(($window->screenwidth / 2) - ($width / 2)); my $y = int(($window->screenheight / 2) - ($height / 2)); $window->geometry($width . "x" . $height . "+" . $x . "+" .$y); }
|
|---|