Why do uimenu items remain depressed after being activated when running a GUI in MATLAB 7.0 (R14)?

2 views (last 30 days)
My GUI features uimenu items associated with a variety of callbacks. When I run my GUI in MATLAB 7.0 (R14) and activate a uimenu item, its appearance remains depressed until I click on the figure or otherwise refresh the window. This can be demonstrated with the following code:
h_fig = figure('Name','Test Figure', 'MenuBar','none',...
'Units','normalized', 'Position',[.1 .1 .5 .5]);
h_menu = uimenu(h_fig,'Label','Click me',...
'Callback','axes(h_axes); plot(5,0,''rp'');');
t = 0:.01:10;
y = sin(2*pi*t);
h_axes = axes('NextPlot','add');
plot(t,y);
title('Test Figure');
This behavior interferes with the execution of certain uimenu item callbacks, for example, a callback involving GINPUT.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
This is a bug in MATLAB 7.0 (R14) in the way uimenu items are rendered.
This bug has been fixed in MATLAB 7.2 (R2006a).
If you are using a previous version of MATLAB, to work around this issue, try disabling the Java features of figures with the following command:
feature('JavaFigures',0);
Note that as a result of disabling the Java figures feature, you will no longer be able to dock/undock figure windows in the desktop, group together undocked figure windows, etc.

More Answers (0)

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!