summaryrefslogtreecommitdiffstats
path: root/library/tk.tcl
diff options
context:
space:
mode:
authorhobbs <hobbs@noemail.net>1999-11-30 00:02:12 (GMT)
committerhobbs <hobbs@noemail.net>1999-11-30 00:02:12 (GMT)
commitf7c61570ef6f7ae395f05904c92c6a4d4bd69420 (patch)
treec42974bab7c577a02bdbc511baa045bd1b616cbf /library/tk.tcl
parente7f836ca54c415f136318b50061fa6eb4d5fb294 (diff)
downloadtk-f7c61570ef6f7ae395f05904c92c6a4d4bd69420.zip
tk-f7c61570ef6f7ae395f05904c92c6a4d4bd69420.tar.gz
tk-f7c61570ef6f7ae395f05904c92c6a4d4bd69420.tar.bz2
* library/tk.tcl: fixed missing $w in ::tk::PlaceWindow
FossilOrigin-Name: 9ffa2a8b1a314010a601f6bd00adda15248bc373
Diffstat (limited to 'library/tk.tcl')
-rw-r--r--library/tk.tcl21
1 files changed, 19 insertions, 2 deletions
diff --git a/library/tk.tcl b/library/tk.tcl
index 30eb70a..e64a98f 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.13 1999/11/24 20:59:06 hobbs Exp $
+# RCS: @(#) $Id: tk.tcl,v 1.14 1999/11/30 00:02:12 hobbs Exp $
#
# Copyright (c) 1992-1994 The Regents of the University of California.
# Copyright (c) 1994-1996 Sun Microsystems, Inc.
@@ -68,10 +68,18 @@ proc ::tk::PlaceWindow {w {placement ""} {anchor ""}} {
set x [expr {([winfo screenwidth $w]-[winfo reqwidth $w])/2}]
set y [expr {([winfo screenheight $w]-[winfo reqheight $w])/2}]
}
- wm geometry +$x+$y
+ wm geometry $w +$x+$y
wm deiconify $w
}
+# ::tk::SetFocusGrab --
+# swap out current focus and grab temporarily (for dialogs)
+# Arguments:
+# grab new window to grab
+# focus window to give focus to
+# Results:
+# Returns nothing
+#
proc ::tk::SetFocusGrab {grab {focus {}}} {
set index "$grab,$focus"
upvar ::tk::FocusGrab($index) data
@@ -88,6 +96,15 @@ proc ::tk::SetFocusGrab {grab {focus {}}} {
}
}
+# ::tk::RestoreFocusGrab --
+# restore old focus and grab (for dialogs)
+# Arguments:
+# grab window that had taken grab
+# focus window that had taken focus
+# destroy destroy|withdraw - how to handle the old grabbed window
+# Results:
+# Returns nothing
+#
proc ::tk::RestoreFocusGrab {grab focus {destroy destroy}} {
set index "$grab,$focus"
foreach {oldFocus oldGrab oldStatus} $::tk::FocusGrab($index) { break }