Bullets in MATLAB GUIs
조회 수: 20 (최근 30일)
이전 댓글 표시
I would like to know if there is in MATLAB some uiobject to implement the functionality of bullets.
댓글 수: 4
Matt Tearle
2011년 2월 18일
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?
채택된 답변
Matt Tearle
2011년 2월 18일
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
Matt Tearle
2011년 2월 18일
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.
추가 답변 (2개)
Walter Roberson
2011년 2월 18일
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>•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
댓글 수: 0
Oleg Komarov
2011년 2월 18일
Are you interested in uitree and uitreenodes, then give a look at this undocumented uitree and the related posts on the bottom.
참고 항목
카테고리
Help Center 및 File Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!