Clear Filters
Clear Filters

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

1 view (last 30 days)
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!

Accepted Answer

Marc
Marc on 24 Nov 2014
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]);

More Answers (0)

Categories

Find more on Dialog Boxes in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!