Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: Help with listbox

Subject: Help with listbox

From: Sudarshan S

Date: 16 Jan, 2008 10:35:04

Message: 1 of 5

Hi, i need help with the list box.
How do i increase the font size of the various items in the
list of a list dialog box??? Is there any specific
parameter or do i have to set the font size by some other
method???

Subject: Help with listbox

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 16 Jan, 2008 17:30:26

Message: 2 of 5

In article <fmkmko$1sl$1@fred.mathworks.com>,
Sudarshan S <sudan.ece@mathworks.com> wrote:
>Hi, i need help with the list box.
>How do i increase the font size of the various items in the
>list of a list dialog box??? Is there any specific
>parameter or do i have to set the font size by some other
>method???

Use HTML specifications:

uicontrol('Style','list', 'String', ...
   {'<HTML><FONT SIZE="+1">Hello</FONT></HTML>', ...
    'world', ...
    '<HTML><FONT SIZE="+2">Frabjous</FONT></HTML>'} );

--
   "Any sufficiently advanced bug is indistinguishable from a feature."
   -- Rich Kulawiec

Subject: Help with listbox

From: matt dash

Date: 16 Jan, 2008 19:15:03

Message: 3 of 5

roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
message <fmlevi$blb$1@canopus.cc.umanitoba.ca>...
> In article <fmkmko$1sl$1@fred.mathworks.com>,
> Sudarshan S <sudan.ece@mathworks.com> wrote:
> >Hi, i need help with the list box.
> >How do i increase the font size of the various items in the
> >list of a list dialog box??? Is there any specific
> >parameter or do i have to set the font size by some other
> >method???
>
> Use HTML specifications:
>
> uicontrol('Style','list', 'String', ...
> {'<HTML><FONT SIZE="+1">Hello</FONT></HTML>', ...
> 'world', ...
> '<HTML><FONT SIZE="+2">Frabjous</FONT></HTML>'} );
>
> --
> "Any sufficiently advanced bug is indistinguishable
from a feature."
> -- Rich Kulawiec

That's pretty cool... is it possible to do the same thing to
give different items in the list different font colors or
background colors?


Subject: Help with listbox

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 16 Jan, 2008 20:04:24

Message: 4 of 5

In article <fmll3n$j2s$1@fred.mathworks.com>,
matt dash <md222@mail.gatech.edu> wrote:
>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
>message <fmlevi$blb$1@canopus.cc.umanitoba.ca>...
>> Use HTML specifications:

>> uicontrol('Style','list', 'String', ...
>> {'<HTML><FONT SIZE="+1">Hello</FONT></HTML>', ...
>> 'world', ...
>> '<HTML><FONT SIZE="+2">Frabjous</FONT></HTML>'} );

>That's pretty cool... is it possible to do the same thing to
>give different items in the list different font colors or
>background colors?

In a recent program, I used

'<HTML><FONT color=red>sample to allpairs</FONT> (1)</HTML>'

If you have some favorite HTML, give it a try.


Note: textwrap() does not know about the HTML tags, so if you
try to use textwrap() to ask what size the string would be
rendered at, you will get the wrong answer.
--
   "Okay, buzzwords only. Two syllables, tops." -- Laurie Anderson

Subject: Help with listbox

From: Yair Altman

Date: 16 Jan, 2008 20:16:01

Message: 5 of 5

"matt dash" <md222@mail.gatech.edu> wrote in message
<fmll3n$j2s$1@fred.mathworks.com>...
> roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
> message <fmlevi$blb$1@canopus.cc.umanitoba.ca>...
> > In article <fmkmko$1sl$1@fred.mathworks.com>,
> > Sudarshan S <sudan.ece@mathworks.com> wrote:
> > >Hi, i need help with the list box.
> > >How do i increase the font size of the various items in
the
> > >list of a list dialog box??? Is there any specific
> > >parameter or do i have to set the font size by some other
> > >method???
> >
> > Use HTML specifications:
> >
> > uicontrol('Style','list', 'String', ...
> > {'<HTML><FONT SIZE="+1">Hello</FONT></HTML>', ...
> > 'world', ...
> > '<HTML><FONT SIZE="+2">Frabjous</FONT></HTML>'} );
> >
> > --
> > "Any sufficiently advanced bug is indistinguishable
> from a feature."
> > -- Rich Kulawiec
>
> That's pretty cool... is it possible to do the same thing to
> give different items in the list different font colors or
> background colors?

Matlab uicontrols are based on Java Swing controls, which in
turn accept the standard HTML tags. This is also true for
tooltips, uimenus, uitable etc. So, for example, you can do
the following: <html><b><u><i>abra</i></u><font
color="red"><sup>kadabra</html>

Note that while HTML support is a documented Java Swing
feature
(http://java.sun.com/docs/books/tutorial/uiswing/components/html.html
or: http://tinyurl.com/5v38m ), this is NOT documented in
Matlab nor does Matlab advertise the fact that its controls
are Java Swing-based.

Yair Altman
http://ymasoftware.com

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

Tag Activity for This Thread
Tag Applied By Date/Time
undocumented Yair Altman 16 Jan, 2008 15:20:15
font size Sudarshan S 16 Jan, 2008 05:40:20
list box Sudarshan S 16 Jan, 2008 05:40:20
rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics