diff options
author | ericm <ericm@noemail.net> | 2000-04-18 02:18:32 (GMT) |
---|---|---|
committer | ericm <ericm@noemail.net> | 2000-04-18 02:18:32 (GMT) |
commit | 23420802e3f855a012e9031cd4952fa826b99e28 (patch) | |
tree | 1a5b1bcdfcedcc57a982da47be2f49a3aba66103 /library/msgbox.tcl | |
parent | 57630e191444466eb9fbb8238eddfb79fee9b940 (diff) | |
download | tk-23420802e3f855a012e9031cd4952fa826b99e28.zip tk-23420802e3f855a012e9031cd4952fa826b99e28.tar.gz tk-23420802e3f855a012e9031cd4952fa826b99e28.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.
FossilOrigin-Name: a39bc3c5994e6804227b828aa86f058d123d81d4
Diffstat (limited to 'library/msgbox.tcl')
-rw-r--r-- | library/msgbox.tcl | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/library/msgbox.tcl b/library/msgbox.tcl index 09928ee..f3df745 100644 --- a/library/msgbox.tcl +++ b/library/msgbox.tcl @@ -3,7 +3,7 @@ # Implements messageboxes for platforms that do not have native # messagebox support. # -# RCS: @(#) $Id: msgbox.tcl,v 1.8 1999/12/03 07:15:02 hobbs Exp $ +# RCS: @(#) $Id: msgbox.tcl,v 1.9 2000/04/18 02:18:33 ericm Exp $ # # Copyright (c) 1994-1997 Sun Microsystems, Inc. # @@ -244,7 +244,18 @@ proc tkMessageBox {args} { wm title $w $data(-title) wm iconname $w Dialog wm protocol $w WM_DELETE_WINDOW { } - wm transient $w $data(-parent) + + # Message boxes should be transient with respect to their parent so that + # they always stay on top of the parent window. But some window managers + # will simply create the child window as withdrawn if the parent is not + # viewable (because it is withdrawn or iconified). This is not good for + # "grab"bed windows. So only make the message box transient if the parent + # is viewable. + # + if { [winfo viewable [winfo toplevel $data(-parent)]] } { + wm transient $w $data(-parent) + } + if {[string equal $tcl_platform(platform) "macintosh"]} { unsupported1 style $w dBoxProc } |