diff options
author | patthoyts@users.sourceforge.net <patthoyts> | 2009-12-30 00:24:27 (GMT) |
---|---|---|
committer | patthoyts@users.sourceforge.net <patthoyts> | 2009-12-30 00:24:27 (GMT) |
commit | 756af4c164b8563a0e58dd41f9e66a660f09026b (patch) | |
tree | 9268c889a4fe88e15101630195dd215218a89219 /tests/menu.test | |
parent | 26b1352471d1b360c1905a4e2d7dd5434f542166 (diff) | |
download | tk-756af4c164b8563a0e58dd41f9e66a660f09026b.zip tk-756af4c164b8563a0e58dd41f9e66a660f09026b.tar.gz tk-756af4c164b8563a0e58dd41f9e66a660f09026b.tar.bz2 |
Patch 2879789: Make torn-off menu entrys activate across whole window
The torn-off menu entries do not activate except immediately over the
label or icon. If the window containing the torn-off menu is expanded
then a lot of dead space may be created, including the cascade arrow.
This patch fixes this making the whole width for any menu entry capable
of activation when the pointer hovers over the item.
Diffstat (limited to 'tests/menu.test')
-rw-r--r-- | tests/menu.test | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/tests/menu.test b/tests/menu.test index dccdf52..1659c58 100644 --- a/tests/menu.test +++ b/tests/menu.test @@ -5,7 +5,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: menu.test,v 1.23 2009/01/13 01:46:06 patthoyts Exp $ +# RCS: @(#) $Id: menu.test,v 1.24 2009/12/30 00:24:27 patthoyts Exp $ package require tcltest 2.2 namespace import ::tcltest::* @@ -3312,6 +3312,47 @@ test menu-22.2 {GetIndexFromCoords} -setup { } -cleanup { deleteWindows } -result {0} +test menu-22.3 {GetIndexFromCoords: mapped window, y only} -setup { + deleteWindows +} -body { + menu .m1 + .m1 add command -label "test" + .m1 configure -tearoff 0 + tk_popup .m1 0 0 + tkwait visibility .m1 + .m1 index @5 +} -cleanup { + deleteWindows +} -result {0} +test menu-22.4 {GetIndexFromCoords: mapped window x,y} -setup { + deleteWindows +} -body { + menu .m1 + .m1 add command -label "test" + .m1 configure -tearoff 0 + tk_popup .m1 0 0 + tkwait visibility .m1 + update + set x [expr {[winfo width .m1] - [.m1 cget -borderwidth] - 1}] + .m1 index @$x,5 +} -cleanup { + deleteWindows +} -result {0} +test menu-22.5 {GetIndexFromCoords: mapped wide window} -setup { + deleteWindows +} -body { + menu .m1 + .m1 add command -label "test" + .m1 configure -tearoff 0 + tk_popup .m1 0 0 + tkwait visibility .m1 + wm geometry .m1 200x100 + update + set x [expr {[winfo width .m1] - [.m1 cget -borderwidth] - 1}] + .m1 index @$x,5 +} -cleanup { + deleteWindows +} -result {0} test menu-23.1 {RecursivelyDeleteMenu} -setup { deleteWindows |