From bcf3d9f03773bc0637c730660eb32b008a923422 Mon Sep 17 00:00:00 2001 From: patthoyts Date: Sun, 3 Jan 2010 01:15:08 +0000 Subject: tearoff menus should be transient and use the toolwindow style on Windows --- ChangeLog | 2 ++ library/tearoff.tcl | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index bcb0a5d..47302fe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2010-01-03 Pat Thoyts + * library/tearoff.tcl: tearoff menus should be transient and use the + toolwindow style on Windows. * tests/menu.test: menu tests using 'tkwait visibility' are unix only. 2010-01-02 Donal K. Fellows diff --git a/library/tearoff.tcl b/library/tearoff.tcl index 9a8bd28..3a99a2d 100644 --- a/library/tearoff.tcl +++ b/library/tearoff.tcl @@ -2,7 +2,7 @@ # # This file contains procedures that implement tear-off menus. # -# RCS: @(#) $Id: tearoff.tcl,v 1.11 2007/04/23 21:16:43 das Exp $ +# RCS: @(#) $Id: tearoff.tcl,v 1.12 2010/01/03 01:15:08 patthoyts Exp $ # # Copyright (c) 1994 The Regents of the University of California. # Copyright (c) 1994-1997 Sun Microsystems, Inc. @@ -80,6 +80,11 @@ proc ::tk::TearOffMenu {w {x 0} {y 0}} { } } + if {[tk windowingsystem] eq "win32"} { + wm transient $menu [winfo toplevel $parent] + wm attributes $menu -toolwindow 1 + } + $menu post $x $y if {[winfo exists $menu] == 0} { -- cgit v0.12