Disable TeX interpreted messages in waitbar
Asked Answered
B

3

5

What is the quickest way to disable TeX markup from displaying in messages in a waitbar? I was expecting an option like

'Interpreter', 'none', ...
Bloomington answered 3/2, 2012 at 10:11 Comment(1)
Hmm as awlays, the usual way: hChild = get(hWaitbar,'Children'); hTitle = get(hChild,'title'); set(hTitle,'Interpreter', 'none');Bloomington
H
9

The Interpreter property is not available for figures I believe (waitbar creates a figure object), but you can apply it afterward to the waitbar message:

h=waitbar(x,message);
set(findall(h,'type','text'),'Interpreter','none');

You could also escape the problematic characters, but that would be a lot more complicated.

Handknit answered 3/2, 2012 at 10:16 Comment(0)
S
4

You can also set the global Tex Interpreter to None, it applies to waitbars as well.

 set(0, 'DefaulttextInterpreter', 'none');
Stenophagous answered 3/2, 2012 at 12:31 Comment(0)
M
0

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);

Which changes the interpreter for the title of the axis that is placed inside the waitbar.

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
Mirianmirielle answered 30/12, 2017 at 23:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.