summaryrefslogtreecommitdiffstats
path: root/library/tk.tcl
diff options
context:
space:
mode:
authordkf <dkf@noemail.net>2003-10-28 15:56:44 (GMT)
committerdkf <dkf@noemail.net>2003-10-28 15:56:44 (GMT)
commit75171642a7a5e13c18e1e4a17a9070a0190ef77c (patch)
tree0244c4a2b3ed23ce5e78f770860bd9627f4b5e96 /library/tk.tcl
parent46d142c6347a7d633de366363025e8eaf44ca65d (diff)
downloadtk-75171642a7a5e13c18e1e4a17a9070a0190ef77c.zip
tk-75171642a7a5e13c18e1e4a17a9070a0190ef77c.tar.gz
tk-75171642a7a5e13c18e1e4a17a9070a0190ef77c.tar.bz2
Make sure we do default placement strategy when placement is empty [Bug 819284]
FossilOrigin-Name: c9ddee9e218bf7e111effafd7780a45dc11d1c63
Diffstat (limited to 'library/tk.tcl')
-rw-r--r--library/tk.tcl8
1 files changed, 6 insertions, 2 deletions
diff --git a/library/tk.tcl b/library/tk.tcl
index 040d741..eed96b3 100644
--- a/library/tk.tcl
+++ b/library/tk.tcl
@@ -3,7 +3,7 @@
# Initialization script normally executed in the interpreter for each
# Tk-based application. Arranges class bindings for widgets.
#
-# RCS: @(#) $Id: tk.tcl,v 1.50 2003/07/31 22:17:14 patthoyts Exp $
+# RCS: @(#) $Id: tk.tcl,v 1.51 2003/10/28 15:56:46 dkf Exp $
#
# Copyright (c) 1992-1994 The Regents of the University of California.
# Copyright (c) 1994-1996 Sun Microsystems, Inc.
@@ -79,7 +79,11 @@ proc ::tk::PlaceWindow {w {place ""} {anchor ""}} {
wm withdraw $w
update idletasks
set checkBounds 1
- if {[string equal -len [string length $place] $place "pointer"]} {
+ if ($place eq ""} {
+ set x [expr {([winfo screenwidth $w]-[winfo reqwidth $w])/2}]
+ set y [expr {([winfo screenheight $w]-[winfo reqheight $w])/2}]
+ set checkBounds 0
+ } elseif {[string equal -len [string length $place] $place "pointer"]} {
## place at POINTER (centered if $anchor == center)
if {[string equal -len [string length $anchor] $anchor "center"]} {
set x [expr {[winfo pointerx $w]-[winfo reqwidth $w]/2}]