diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-04-20 12:27:15 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-04-20 12:27:15 (GMT) |
commit | 4c59c50538a9f6a2af4ee45f406c0e6e6d47f5c6 (patch) | |
tree | 67282c401e49141494e4c57d279601278e19b21c /library/dialog.tcl | |
parent | b8cbd876377862fd90f1909609237d79f620214e (diff) | |
parent | 0b0a00eec7fa1ecd6077b0cc579699edbaadfae5 (diff) | |
download | tk-4c59c50538a9f6a2af4ee45f406c0e6e6d47f5c6.zip tk-4c59c50538a9f6a2af4ee45f406c0e6e6d47f5c6.tar.gz tk-4c59c50538a9f6a2af4ee45f406c0e6e6d47f5c6.tar.bz2 |
Use vroot size in stead of screen size for clipping window coordinates in ::tk::PlaceWindow.
Use ::tk::PlaceWindow in dialog.tcl, in stead of dumplicating the code there.
Diffstat (limited to 'library/dialog.tcl')
-rw-r--r-- | library/dialog.tcl | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/library/dialog.tcl b/library/dialog.tcl index 1ae5b8a..adea259 100644 --- a/library/dialog.tcl +++ b/library/dialog.tcl @@ -146,27 +146,9 @@ proc ::tk_dialog {w title text bitmap default args} { # 6. Withdraw the window, then update all the geometry information # so we know how big it wants to be, then center the window in the - # display and de-iconify it. - - wm withdraw $w - update idletasks - set x [expr {[winfo screenwidth $w]/2 - [winfo reqwidth $w]/2 \ - - [winfo vrootx [winfo parent $w]]}] - set y [expr {[winfo screenheight $w]/2 - [winfo reqheight $w]/2 \ - - [winfo vrooty [winfo parent $w]]}] - # Make sure that the window is on the screen and set the maximum - # size of the window is the size of the screen. That'll let things - # fail fairly gracefully when very large messages are used. [Bug 827535] - if {$x < 0} { - set x 0 - } - if {$y < 0} { - set y 0 - } - wm maxsize $w [winfo screenwidth $w] [winfo screenheight $w] - wm geometry $w +$x+$y - wm deiconify $w + # display (Motif style) and de-iconify it. + ::tk::PlaceWindow $w tkwait visibility $w # 7. Set a grab and claim the focus too. |