|
From: SourceForge.net <no...@so...> - 2009-01-28 17:11:37
|
Bugs item #2543460, was opened at 2009-01-28 18:11 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112997&aid=2543460&group_id=12997 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 04. Canvas Basics Group: current: 8.5.6 Status: Open Resolution: None Priority: 5 Private: No Submitted By: mescalinum (mescalinum) Assigned to: Jeffrey Hobbs (hobbs) Summary: Enter/Leave cnv events not reported while mouse btn is down Initial Comment: consider this little testcase: pack [canvas .c -width 300 -height 190 -background white] # two test items .c create rectangle 20 30 40 50 -tags red -fill red .c create rectangle 80 30 100 50 -tags black -fill black # text items for showing what's happening .c create text 20 90 -text {red: } -tags txt1 -anchor nw .c create text 20 120 -text {tags: } -tags txt2 -anchor nw # bind <Enter> and <Leave> .c bind red <Enter> {.c itemconfigure txt1 -text red:\ Enter} .c bind red <Leave> {.c itemconfigure txt1 -text red:\ Leave} # the workaround: (this fails too) bind .c <Motion> {.c itemconfigure txt2 -text tags:\ [.c gettags [.c find withtag current]]} # not really needed for this testcase: bind .c <ButtonPress> {.c configure -background red} bind .c <ButtonRelease> {.c configure -background white} item with 'red' tag is bound to <Enter> and <Leave> events. but it works only when the bouse button are not pressed. if you click in the white area and drag over the red item, it won't send the <Enter>/<Leave> events. in addition, an attempt to workaround this issue by using [.canvas find withtag current&&$myTag] would fail too, because tag 'current' is not updated while mouse button is down. I don't know if this is expected, or not. reading the manual of canvas I'd expect 'current' tag and <Enter>/<Leave> events to work in any condition. I'm not filing a bug about documentation though. I'd rather want those things working (perhaps enabled by some exotic [canvas] option), because a full workaround on this issue implies various nested loops, to track position and retrieve all the tags, and match them, and other than awful, I think it could turn into a performance hog. Best regards ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112997&aid=2543460&group_id=12997 |