summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2003-10-28 15:59:31 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2003-10-28 15:59:31 (GMT)
commit298bf949d9b3d9909ca44a3785afb833bc73c6a9 (patch)
treed8dd893e2bf5de1a425d817b8a89d30e1b0f6b59
parent2b5dcb0f64726e8ebf0793892d2a89ac5bcf4f5e (diff)
downloadtk-298bf949d9b3d9909ca44a3785afb833bc73c6a9.zip
tk-298bf949d9b3d9909ca44a3785afb833bc73c6a9.tar.gz
tk-298bf949d9b3d9909ca44a3785afb833bc73c6a9.tar.bz2
Make sure we do default placement strategy when placement is empty [Bug 819284]
-rw-r--r--ChangeLog5
-rw-r--r--library/tk.tcl8
2 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 67c1c12..aa51442 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-10-28 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/tk.tcl (::tk::PlaceWindow): Added check for empty string
+ first when determining placement strategy. [Bug 819284]
+
2003-10-22 Donal K. Fellows <fellowsd@cs.man.ac.uk>
* library/dialog.tcl (tk_dialog): Constrain the dialog to be
diff --git a/library/tk.tcl b/library/tk.tcl
index 1d0d3d0..0d5b2ed 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.46 2003/02/18 21:24:39 hobbs Exp $
+# RCS: @(#) $Id: tk.tcl,v 1.46.2.1 2003/10/28 15:59:34 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 {[string equal $place ""]} {
+ 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}]