uimenus occasionally flash in my GUI

8 views (last 30 days)
Arthur
Arthur on 25 Feb 2011
I have a figure with uimenus added to it (but MenuBar is off, so it's only my menus), each with one level of child menu items, such as the usual File, Edit, and Help menus. Sometimes the uimenus will flash, as if I had pressed "alt", used the arrow keys to highlight each item, then pressed "alt" again to cancel the menu selection. I have not figured out a pattern to when this happens, but I'm noticing it after clicking a uipushtool or choosing a uimenu. It does not happen every time, or it's happening so fast that it doesn't paint the window. I'm seeing this in R2010b.
Has anyone else seen this, and do you know what can be done to stop it? It's really distracting and makes the program look unprofessional.

Accepted Answer

Arthur
Arthur on 24 Jun 2011
I discovered the culprit while digging around in the Java objects of a GUI under development. If you use findjobj to retrieve the Java object corresponding to an HG object, it may cause the menu flashing behavior I was seeing. In particular, it happens when findjobj is processing the menu objects. This can be disabled using the 'nomenu' option.
I was seeing menu flashes when calling findjobj(gcbf, 'depth', 0) to get the Java frame for the current figure. Changing that to findjobj(gcbf, 'nomenu', 'depth', 0) eliminated the flash.

More Answers (0)

Categories

Find more on Interactive Control and Callbacks in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!