Bullets in MATLAB GUIs

I would like to know if there is in MATLAB some uiobject to implement the functionality of bullets.

4 comentarios

Matt Tearle
Matt Tearle el 18 de Feb. de 2011
What do you mean by the functionality of bullets? Do you want some output given as a bulleted list of text?
Mtlb Usr
Mtlb Usr el 18 de Feb. de 2011
Hi Matt,
When I have said funcionality of bullets I would refer to a uiobject for create a bullet in Matlab's GUI.
For example:
.aaaa
.bbbb
.cccc
Being the point previous like a bullet that I need.
Do you understand me?
regards
Matt Tearle
Matt Tearle el 18 de Feb. de 2011
But what (if anything) do you want the bullets to *do*? Or are you just looking for output display? In other words, would a text box suffice, if you could format the text to display a bulleted list?
Mtlb Usr
Mtlb Usr el 18 de Feb. de 2011
I'm just looking for output display.
Yes, I could give a format to one uicontrol with a text style, would be correct! But I don't know how I can do it.
regards

Iniciar sesión para comentar.

 Respuesta aceptada

Matt Tearle
Matt Tearle el 18 de Feb. de 2011

1 voto

It's not great (see Walter's answer for more discussion), but this basically works:
x = {'abc';'defg';'hijkl';'mn'};
y = regexprep(x,'(.*)',[char(183),' $1']);
figure
uicontrol('style','text','position',[100,100,100,100],'string',y,'fontsize',12)
I'm assuming you have a cell array of text, one cell per bullet point.

3 comentarios

Walter Roberson
Walter Roberson el 18 de Feb. de 2011
y = strcat(char(183), x);
would be easier to understand (though not necessarily faster for sure.)
Mtlb Usr
Mtlb Usr el 18 de Feb. de 2011
Hi Matt,
Yes u are right.
Ok, I think that with your purpose I will can do it. For this reason, I'm going to accept this answer but If I would go farther I would see the Walter's discussion.
thanks
regards
Matt Tearle
Matt Tearle el 18 de Feb. de 2011
Walter, you're right. I can never keep track of which string functions work with cell arrays. (Plus who doesn't love the chance to mess with regular expressions!)
Mtlb Usr, glad this works for you. Another possibility would be to hack it by making an axes instead of a text box, and plotting a marker, followed by a text annotation. Messy, but I think it would work.

Iniciar sesión para comentar.

Más respuestas (2)

Walter Roberson
Walter Roberson el 18 de Feb. de 2011

1 voto

The more likely to work is to put char(183) at that point. That is officially "middot", a relatively small mark.
What might work is to use, e.g.,
<HTML>&bull;cccc
The <HTML> must be the first thing in the string for that particular line.
If it works it will be Unicode character 8226, which is not normally possible to put in to a uicontrol; see more discussion here
Oleg Komarov
Oleg Komarov el 18 de Feb. de 2011

0 votos

Are you interested in uitree and uitreenodes, then give a look at this undocumented uitree and the related posts on the bottom.

1 comentario

Mtlb Usr
Mtlb Usr el 18 de Feb. de 2011
Hi Oleg,
I'm not interested in a tree. I think that these structures are valid when you are going to display several directories or folders.
thank you
regards

Iniciar sesión para comentar.

Categorías

Más información sobre Creating, Deleting, and Querying Graphics Objects en Centro de ayuda y File Exchange.

Preguntada:

el 18 de Feb. de 2011

Community Treasure Hunt

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

Start Hunting!

Translated by