diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-04-20 12:23:56 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-04-20 12:23:56 (GMT) |
commit | 72dea207ae279d05cfa07445b767e0efb4bb6702 (patch) | |
tree | ab880bbfe157359df231d47bd8a411c4f405cc03 /library/tk.tcl | |
parent | 851c442b53473d494521a4633e8d764cb5d5e45a (diff) | |
parent | 8077dd948e9d7c758be18837a1cc637007e50084 (diff) | |
download | tk-72dea207ae279d05cfa07445b767e0efb4bb6702.zip tk-72dea207ae279d05cfa07445b767e0efb4bb6702.tar.gz tk-72dea207ae279d05cfa07445b767e0efb4bb6702.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/tk.tcl')
-rw-r--r-- | library/tk.tcl | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/library/tk.tcl b/library/tk.tcl index 8e967cb..a852a0b 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -117,21 +117,22 @@ proc ::tk::PlaceWindow {w {place ""} {anchor ""}} { set checkBounds 0 } if {$checkBounds} { - if {$x < 0} { - set x 0 - } elseif {$x > ([winfo screenwidth $w]-[winfo reqwidth $w])} { - set x [expr {[winfo screenwidth $w]-[winfo reqwidth $w]}] + if {$x < [winfo vrootx $w]} { + set x [winfo vrootx $w] + } elseif {$x > ([winfo vrootx $w]+[winfo vrootwidth $w]-[winfo reqwidth $w])} { + set x [expr {[winfo vrootx $w]+[winfo vrootwidth $w]-[winfo reqwidth $w]}] } - if {$y < 0} { - set y 0 - } elseif {$y > ([winfo screenheight $w]-[winfo reqheight $w])} { - set y [expr {[winfo screenheight $w]-[winfo reqheight $w]}] + if {$y < [winfo vrooty $w]} { + set y [winfo vrooty $w] + } elseif {$y > ([winfo vrooty $w]+[winfo vrootheight $w]-[winfo reqheight $w])} { + set y [expr {[winfo vrooty $w]+[winfo vrootheight $w]-[winfo reqheight $w]}] } if {[tk windowingsystem] eq "aqua"} { # Avoid the native menu bar which sits on top of everything. if {$y < 22} { set y 22 } } } + wm maxsize $w [winfo vrootwidth $w] [winfo vrootheight $w] wm geometry $w +$x+$y wm deiconify $w } |