uimenus occasionally flash in my GUI

1 次查看(过去 30 天)
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.

采纳的回答

Arthur
Arthur 2011-6-24
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by