Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Multiple line tooltips

Subject: Multiple line tooltips

From: Joaquim luis

Date: 12 Mar, 2003 20:11:47

Message: 1 of 7

How can I do to have multiple line tootltips in GUI elements?
Thanks.

Subject: Multiple line tooltips

From: Brett Shoelson

Date: 13 Mar, 2003 13:02:52

Message: 2 of 7


"Joaquim Luis" <jluis@ualg.pt> wrote in message
news:eebab65.-1@WebX.raydaftYaTP...
> How can I do to have multiple line tootltips in GUI elements?
> Thanks.

figure,uicontrol('style','pushbutton','tooltipstring',sprintf('Here is line
1.\nAnd this is line 2.'));

Cheers,
Brett

Subject: Multiple line tooltips

From: Joaquim luis

Date: 13 Mar, 2003 13:19:40

Message: 3 of 7

Brett Shoelson wrote:
>
>
>
> "Joaquim Luis" <jluis@ualg.pt> wrote in message
> news:eebab65.-1@WebX.raydaftYaTP...
>> How can I do to have multiple line tootltips in GUI elements?
>> Thanks.
>
> figure,uicontrol('style','pushbutton','tooltipstring',sprintf('Here
is line
> 1.\nAnd this is line 2.'));
>
> Cheers,
> Brett
>
Thanks Brett
But I'll refine my question. Is there anyway to do it from GUIDE? (I
tried to put there the \n, but no way)
>

Subject: Multiple line tooltips

From: Brett Shoelson

Date: 13 Mar, 2003 14:01:54

Message: 4 of 7


"Joaquim Luis" <jluis@ualg.pt> wrote in message
news:eebab65.1@WebX.raydaftYaTP...
> Brett Shoelson wrote:
> >
> >
> >
> > "Joaquim Luis" <jluis@ualg.pt> wrote in message
> > news:eebab65.-1@WebX.raydaftYaTP...
> >> How can I do to have multiple line tootltips in GUI elements?
> >> Thanks.
> >
> > figure,uicontrol('style','pushbutton','tooltipstring',sprintf('Here
> is line
> > 1.\nAnd this is line 2.'));
> >
> > Cheers,
> > Brett
> >
> Thanks Brett
> But I'll refine my question. Is there anyway to do it from GUIDE? (I
> tried to put there the \n, but no way)
> >

Sorry, I don't know. I never use GUIDE. (I did try it with sprintf, but only
confirmed your statement.)
Brett

Subject: Multiple line tooltips

From: geomod

Date: 3 Sep, 2011 20:50:25

Message: 5 of 7

"Brett Shoelson" <shoelson@helix.nih.gov> wrote in message <CA4ca.15$N5.158@mencken.net.nih.gov>...
>
> "Joaquim Luis" <jluis@ualg.pt> wrote in message
> news:eebab65.1@WebX.raydaftYaTP...
> > Brett Shoelson wrote:
> > >
> > >
> > >
> > > "Joaquim Luis" <jluis@ualg.pt> wrote in message
> > > news:eebab65.-1@WebX.raydaftYaTP...
> > >> How can I do to have multiple line tootltips in GUI elements?
> > >> Thanks.
> > >
> > > figure,uicontrol('style','pushbutton','tooltipstring',sprintf('Here
> > is line
> > > 1.\nAnd this is line 2.'));
> > >
> > > Cheers,
> > > Brett
> > >
> > Thanks Brett
> > But I'll refine my question. Is there anyway to do it from GUIDE? (I
> > tried to put there the \n, but no way)
> > >
>
> Sorry, I don't know. I never use GUIDE. (I did try it with sprintf, but only
> confirmed your statement.)
> Brett
>
>

In case anyone also faced this challenge working with GUIDE, you can fix it by adding the following line to the _OpeningFcn():
set(handles.TAG, 'Tooltipstring', sprintf('Here is line 1.\nAnd this is line 2.'));

Subject: Multiple line tooltips

From: Yair Altman

Date: 4 Sep, 2011 19:00:28

Message: 6 of 7

"Joaquim Luis" <jluis@ualg.pt> wrote in message <eebab65.1@WebX.raydaftYaTP>...
> Brett Shoelson wrote:
> >
> >
> >
> > "Joaquim Luis" <jluis@ualg.pt> wrote in message
> > news:eebab65.-1@WebX.raydaftYaTP...
> >> How can I do to have multiple line tootltips in GUI elements?
> >> Thanks.
> >
> > figure,uicontrol('style','pushbutton','tooltipstring',sprintf('Here
> is line
> > 1.\nAnd this is line 2.'));
> >
> > Cheers,
> > Brett
> >
> Thanks Brett
> But I'll refine my question. Is there anyway to do it from GUIDE? (I
> tried to put there the \n, but no way)


There is a way to do it in GUIDE: simply use HTML formatting in the control's String or TooltipString properties, as follows:
'<html>Here is line 1.<br/>And this is line 2.'

More info:
http://UndocumentedMatlab.com/blog/html-support-in-matlab-uicomponents/
http://UndocumentedMatlab.com/blog/spicing-up-matlab-uicontrol-tooltips/

Yair Altman
http://UndocumentedMatlab.com

Subject: Multiple line tooltips

From: Michel bertrand

Date: 11 Jul, 2014 22:41:11

Message: 7 of 7

"Yair Altman" wrote in message <j40hsc$mv3$1@newscl01ah.mathworks.com>...
> "Joaquim Luis" <jluis@ualg.pt> wrote in message <eebab65.1@WebX.raydaftYaTP>...
> > Brett Shoelson wrote:
> > >
> > >
> > >
> > > "Joaquim Luis" <jluis@ualg.pt> wrote in message
> > > news:eebab65.-1@WebX.raydaftYaTP...
> > >> How can I do to have multiple line tootltips in GUI elements?
> > >> Thanks.
> > >
> > > figure,uicontrol('style','pushbutton','tooltipstring',sprintf('Here
> > is line
> > > 1.\nAnd this is line 2.'));
> > >
> > > Cheers,
> > > Brett
> > >
> > Thanks Brett
> > But I'll refine my question. Is there anyway to do it from GUIDE? (I
> > tried to put there the \n, but no way)
>
>
> There is a way to do it in GUIDE: simply use HTML formatting in the control's String or TooltipString properties, as follows:
> '<html>Here is line 1.<br/>And this is line 2.'
>
> More info:
> http://UndocumentedMatlab.com/blog/html-support-in-matlab-uicomponents/
> http://UndocumentedMatlab.com/blog/spicing-up-matlab-uicontrol-tooltips/
>
> Yair Altman
> http://UndocumentedMatlab.com

Great, so simple; thanks
Michel Bertrand

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us