I’m currently experimenting with Popup menus and am wondering what your opinions are on how to best implement a “hit test” feature for the Popup menu? In essence, I have a Popupmenu that is tied to a DrawableButton using .showat() function call. However, once the popupmenu is created, the user has to actually click somewhere outside of the popupmenu to close it or click on an option within the popup menu.
What I’m trying to implement is for the popup menu to disappear when the mouse is not over the DrawableButton that the popup menu is attached to or when the mouse is not over the actual Popup menu. Effectively, I only want the popup menu to appear when the mouse is nearby where it appears and disappears when it isn’t.
I’m not entirely sure how to best implement this? Is there a viable function in the LookAndFeel methods that I could override for Popup menu that can easily accomplish this? I haven’t been able to find a solid location where it would make the most sense to implement this type of feature.