uimenus occasionally flash in my GUI

8 vues (au cours des 30 derniers jours)
Arthur
Arthur le 25 Fév 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.

Réponse acceptée

Arthur
Arthur le 24 Juin 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.

Plus de réponses (0)

Catégories

En savoir plus sur Interactive Control and Callbacks dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by