Thread TopLevel positionieren: in der Mitte von MainWindow (14 answers)
Opened by format_c at 2004-04-23 21:10

format_c
 2004-04-25 15:38
#41969 #41969
User since
2003-08-04
1706 Artikel
HausmeisterIn
[Homepage] [default_avatar]
So:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
    my $w = 250;
my $h = 200;
# Top-Level Fenster erzeugen
my $tl_window = $Config{main_window}
->Toplevel(-title => 'Über Kontoauszüge',
-width => $w,
-height => $h
);
my ($width,$height,$pos_x,$pos_y) = split /\+|x/,$Config{main_window}->geometry();

# Top Level in Mitte des MainWindows positionieren
$tl_window->geometry('+' .
int ($width / 2 + $pos_x - $w / 2) .
'+' .
int ($height / 2 + $pos_y - $h / 2)
);


Gruß Alex

View full thread TopLevel positionieren: in der Mitte von MainWindow