home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2000 December
/
PCWorld_2000-12_cd.bin
/
Komunikace
/
Comanche
/
extra
/
center.tcl
next >
Wrap
Text File
|
2000-11-02
|
510b
|
20 lines
# FRom an Usenet post by Jeroen Hoppenbrouwers <hoppie@kub.nl>
proc centerScreen {w} {
# Center the window on the screen.
# <in> w = A toplevel window.
global tcl_platform
if [string match $tcl_platform(platform) windows] {
return
}
wm withdraw $w
update idletasks
set x [expr [winfo screenwidth $w]/2 - [winfo reqwidth $w]/2]
set y [expr [winfo screenheight $w]/2 - [winfo reqheight $w]/2]
wm geom $w +$x+$y
update idletasks
wm deiconify $w
update idletasks
}