GUIDE using CreateFcn to set TooltipString?

Hello everyone,
simple question, is it possible to change the TooltipString value of a static text in its CreateFcn? I want to display a formula, normally I would do it with following code:
set(handles.statictext,'TooltipString','somewhat longer formula here','Interpreter','latex')
Problem here is that the handles.statictext does not yet exist in its CreateFcn. If I only do:
set('TooltipString','somewhat longer formula here','Interpreter','latex')
it does not work either. Maybe there is a way to set the TooltipString interpreter to latex in the GUI Inspector in GUIDE?
Thanks for your help!

4 Commenti

hObject is an input argument to the CreateFcn. Can't you just use that?
Ingo Rück
Ingo Rück il 11 Ott 2017
Modificato: Ingo Rück il 11 Ott 2017
I have to correct myself, this is not working either. Changing the TooltipString itself with
set(hObject,'TooltipString','text')
is working to change the text, but I cant display a formula using latex this way. Error is: There is no Interpreter property on the UIControl class.
Yeah, I don't think you can do anything fancy with tooltips beyond just setting a string. Even edit boxes and text boxes themselves don't support advanced formatting without resorting to HTML or underlying java objects, as far as I am aware.
Not even static textboxes? Damn thats a bummer..

Accedi per commentare.

 Risposta accettata

ES
ES il 11 Ott 2017
You can do it in OpenFcn! Is there any specific reason, why you do it in CreateFcn?

3 Commenti

I would prefer if I could just set it in the Object Inspector in GUIDE. I can set the TooltipString there, but I cant make it interpret the string as latex.
I dont see another way to change the TooltipString right from the start.
When I try to change it in the OpenFcn I get the same error as above: There is no Interpreter property on the UIControl class.
Does this basically mean that it is impossible to use Latex to put a formula into the Tooltip string?
@Ingo: The error message is clear: There is no interpreter in uicontrol objects. Then you cannot display LaTeX directly in a tooltip string.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su App Building in Centro assistenza e File Exchange

Richiesto:

il 11 Ott 2017

Commentato:

Jan
il 11 Ott 2017

Community Treasure Hunt

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

Start Hunting!

Translated by