home *** CD-ROM | disk | FTP | other *** search
-
- # 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
- }
-