how do i make 'Interpreter', 'none' work inside the waitbar text?

45 vues (au cours des 30 derniers jours)
mat
mat le 13 Juin 2013
Commenté : Adam Danz le 29 Jan 2024
hi
what is the equivalent for " 'Interpreter', 'none' " in the 'waitbar' framework?
thanks a lot,
matty
  2 commentaires
Stefano Monfardini
Stefano Monfardini le 14 Avr 2016
Hi, same question for me
Guillaume
Guillaume le 14 Avr 2016
@Stefano, please ask your own question. That way when it is answered you can accept the answer.
Note that the 2016 answer would not apply to the 2013 version of matlab

Connectez-vous pour commenter.

Réponse acceptée

Max Snippe
Max Snippe le 30 Déc 2017
Instead of searching for the object one might change the interpreter directly with the 'dot-notation' (available since R2014b) as in the following MWE:
wb = waitbar(0/10,'My_waitbar_string_with_underscores');
wb.Children.Title.Interpreter = 'none';
for i = 1:10
waitbar(i/10,wb,'My_waitbar_string_with_underscores');
pause(1);
end
delete(wb);
Note that if you use a cancel button in the waitbar, the number of children of the object changes and one might have to change
wb.Children.Title.Interpreter
to
wb.Children(2).Title.Interpreter
  3 commentaires
David Emerson
David Emerson le 7 Oct 2021
This should definitely be the answer! Worked great for me.
Adam Danz
Adam Danz le 29 Jan 2024
Here's another version that doesn't rely on child order
wb = waitbar(__);
set(gca(wb).Title,'Interpreter','none')

Connectez-vous pour commenter.

Plus de réponses (2)

Orion
Orion le 14 Avr 2016
Hi,
Here's one way to do it
% Create a classic waitbar
h = waitbar(0,'my_name');
% change the interpreter of the String
myString = findall(h,'String','my_name');
set(myString,'Interpreter','none')

mat
mat le 14 Avr 2016
Modifié(e) : Walter Roberson le 14 Avr 2016
thanks a lot :)
i used th following version:
wb = waitbar(0,'txt');
h=findobj(wb,'Type','figure');
ht = get(get(h,'currentaxes'),'title');
set(ht,'interpreter','none')
matty

Catégories

En savoir plus sur Dialog Boxes dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by