diff options
author | ericm <ericm> | 2000-04-18 02:18:32 (GMT) |
---|---|---|
committer | ericm <ericm> | 2000-04-18 02:18:32 (GMT) |
commit | 3b8d97bbddc028359dd7f579f7f4e2fdaf887752 (patch) | |
tree | 1a5b1bcdfcedcc57a982da47be2f49a3aba66103 /library/dialog.tcl | |
parent | 642a893448534c32d814fa625c78d6ab695cad1b (diff) | |
download | tk-3b8d97bbddc028359dd7f579f7f4e2fdaf887752.zip tk-3b8d97bbddc028359dd7f579f7f4e2fdaf887752.tar.gz tk-3b8d97bbddc028359dd7f579f7f4e2fdaf887752.tar.bz2 |
* win/tkWinDialog.c: Added checks for visibility of parent window
before creating MessageBox and ChooseColor dialogs; this prevents
the application from locking when the parent is withdrawn and the
message box is created. In these cases, the window will be
created without a parent.
* unix/mkLinks: Added WinViewable.3.
* tests/msgbox.test: Added tests for patch from [Bug: 4997].
* library/msgbox.tcl:
* library/dialog.tcl: Applied patch from [Bug: 4997]; detaches
dialog window from parent if parent is not viewable.
* library/bgerror.tcl: Removed workaround from [Bug: 4370]; this
is superceeded by patches to dialog.tcl.
* generic/tkCmds.c: Changed WinfoObjCmd to use Tk_IsViewable
function to determine visibility of windows instead of inlining
the code.
* generic/tkStubInit.c:
* generic/tkDecls.h:
* generic/tk.decls: Added Tk_IsViewable declaration.
Diffstat (limited to 'library/dialog.tcl')
-rw-r--r-- | library/dialog.tcl | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/library/dialog.tcl b/library/dialog.tcl index 499526e..b3c9dbd 100644 --- a/library/dialog.tcl +++ b/library/dialog.tcl @@ -3,7 +3,7 @@ # This file defines the procedure tk_dialog, which creates a dialog # box containing a bitmap, a message, and one or more buttons. # -# RCS: @(#) $Id: dialog.tcl,v 1.7 2000/01/12 11:45:14 hobbs Exp $ +# RCS: @(#) $Id: dialog.tcl,v 1.8 2000/04/18 02:18:33 ericm Exp $ # # Copyright (c) 1992-1993 The Regents of the University of California. # Copyright (c) 1994-1997 Sun Microsystems, Inc. @@ -53,12 +53,17 @@ proc tk_dialog {w title text bitmap default args} { wm iconname $w Dialog wm protocol $w WM_DELETE_WINDOW { } - # The following command means that the dialog won't be posted if - # [winfo parent $w] is iconified, but it's really needed; otherwise - # the dialog can become obscured by other windows in the application, - # even though its grab keeps the rest of the application from being used. + # Dialog boxes should be transient with respect to their parent, + # so that they will always stay on top of their parent window. However, + # some window managers will create the window as withdrawn if the parent + # window is withdrawn or iconified. Combined with the grab we put on the + # window, this can hang the entire application. Therefore we only make + # the dialog transient if the parent is viewable. + # + if { [winfo viewable [winfo toplevel [winfo parent $w]]] } { + wm transient $w [winfo toplevel [winfo parent $w]] + } - wm transient $w [winfo toplevel [winfo parent $w]] if {[string equal $tcl_platform(platform) "macintosh"]} { unsupported1 style $w dBoxProc } |