summaryrefslogtreecommitdiffstats
path: root/library/tk.tcl
diff options
context:
space:
mode:
authorhobbs <hobbs>1999-11-30 00:02:12 (GMT)
committerhobbs <hobbs>1999-11-30 00:02:12 (GMT)
commit0c44d9f04d5692595e2366ea5122981663358f4b (patch)
treec42974bab7c577a02bdbc511baa045bd1b616cbf /library/tk.tcl
parent6ed6cecb4300435fdd8b959f6910322439f28463 (diff)
downloadtk-0c44d9f04d5692595e2366ea5122981663358f4b.zip
tk-0c44d9f04d5692595e2366ea5122981663358f4b.tar.gz
tk-0c44d9f04d5692595e2366ea5122981663358f4b.tar.bz2
* library/tk.tcl: fixed missing $w in ::tk::PlaceWindow
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 }