diff options
author | patthoyts <patthoyts@users.sourceforge.net> | 2009-12-30 00:24:27 (GMT) |
---|---|---|
committer | patthoyts <patthoyts@users.sourceforge.net> | 2009-12-30 00:24:27 (GMT) |
commit | 3147e53de56d78b75db674135ff4782d49467c73 (patch) | |
tree | 9268c889a4fe88e15101630195dd215218a89219 /tests/menu.test | |
parent | 13dfb9e00306c6d37b855ff603417c623e1d50f8 (diff) | |
download | tk-3147e53de56d78b75db674135ff4782d49467c73.zip tk-3147e53de56d78b75db674135ff4782d49467c73.tar.gz tk-3147e53de56d78b75db674135ff4782d49467c73.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 |