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

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

采纳的回答

MathWorks Support Team
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.

更多回答(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