How to use the waitbar on the figure with MATLAB 2014b

1 次查看(过去 30 天)
I´ve used my waitbar on my figure by transferring the data onto it.
h = waitbar(0,' ','Visible','off' ); %
c = get(h,'Children');
set(c,'Parent',handles.thisfig); % Set the position of the WAITBAR on your figure
set(c,'Units','pixels','Position',[1 2 798 18]);
set(findobj(c,'type','patch'), ...
'edgecolor',[1,0.8,0.4],'facecolor',[0.15,0.15,0.15])
set(c,'Color', [0.05,0.05,0.05]);
c.Visible = 'On';
then... with waitbar(x) (0<x<1) I could increase the bar. It doesen´t seem to work with Matlab 2014b. (worked with 2014a)
I´ve tried a lot to get it back to work but no success.
How do I get a waitbar onto my figure with Matlab 2014b?
Thanks!

采纳的回答

Marc
Marc 2014-11-24
I've managed to make it work again.
First if you´ve used edgecolor and facecolor, this isn´t working.
I used XColor and YColor now.
then I´ve put my new waitbar into handles:
h = waitbar(0,' ','Visible','off' ); %
% Close the default figure
% The child of the waitbar is an axes object. Grab the axes
% object 'c' and set its parent to be your figure f so that it now
% resides on figure f rather than on the old default figure.
c = get(h,'Children');
set(c,'Parent',handles.thisfig); % Set the position of the WAITBAR on your figure
set(c,'Units','pixels','Position',[1 2 0 18]);
set(c,'XColor',[1,0.8,0.4]);
set(c,'YColor',[1,0.8,0.4]);
set(c,'Color', [0.09,0.09,0.09]);
c.Visible = 'On';
handles.splash_waitbar = c;
handles.splash_waitbar.Visible = 'On';
in my other File, I use the "Position value" to increase the bar as I want to. while you have to multiply your "waitbar"-expression with the max-width of the bar.
value = 798 *((step) / (maxstep));
set(handles.splash_waitbar,'Position',[1 2 value 18]);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Dialog Boxes 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by