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

2 visualizaciones (últimos 30 días)
Marc
Marc el 24 de Nov. de 2014
Respondida: Marc el 24 de Nov. de 2014
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!

Respuesta aceptada

Marc
Marc el 24 de Nov. de 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]);

Más respuestas (0)

Categorías

Más información sobre Dialog Boxes en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by