uimenus occasionally flash in my GUI

8 Ansichten (letzte 30 Tage)
Arthur am 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.

Akzeptierte Antwort

Arthur am 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.

Weitere Antworten (0)


Mehr zu Interactive Control and Callbacks finden Sie in Help Center und File Exchange


Community Treasure Hunt

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

Start Hunting!

Translated by