Weird (?) behavior of a contextual menu
Weird (?) behavior of a contextual menu
- Subject: Weird (?) behavior of a contextual menu
- From: Andrea Perego <email@hidden>
- Date: Fri, 18 Jan 2002 16:40:53 +0100
Hi all!
While experimenting with contextual menus (I mean, menus attached to
views that appear when one control-clicks) I've found this strange
behavior:
mouseMoved events are normally enabled for the window where my view
with a contextual menu is located. Control-clicking causes the menu
to be displayed correctly. Depending on the view state, the
contextual menu has an item with a submenu attached or just the
submenu title not enabled (setAutoenablesItems:NO for the menu and
enabling managed by the code).
If the user dismisses the menu by moving the mouse outside it and
releasing the button, two different scenarios are possible:
- if the submenu has been displayed, a "mouseExited" and
"mouseEntered" message are issued, in the given sequence.
- if the menu item with the submenu is not enabled, no event message is issued
(I'm tracking also "mouseDown" and "mouseUp") and - here lies my complaint -
"mouseMoved" events are no longer sent.
Maybe this is caused my some mistake on my part: otherwise, it would
smell to me like a bug, since I see just two correct ways to manage
such a thing:
- being completely transparent to the application, but restoring
everything as it was before, e.g., in my case, without disabling
"mouseMoved" events.
- sending appropriate events/notifications/whateverproper to the
application before (and this is OK, since "menuForEvent" may play
this role, I guess) and
*after* the contextual menu exited the scene.
If someone of you has already experienced similar or related
behaviors, I'd like to know about.
TIA
Andrea Perego
University of Florence - Phys. Dept.