font control in uimenu objects

조회 수: 6 (최근 30일)
Arabarra
Arabarra 2018년 6월 23일
편집: Walter Roberson 2018년 6월 23일
Hi,
is there some obscure trick to change the fonts in uimenus? I use uimenus to show tabulated data:
name : <foo>
address : <foo>
phone number : <foo>
In two subsequent uimenus I reserve the same amount of spaces before the colon, but as the default font that matlab assigns to uimenu objects does not have a fixed width, my uimenus look horrible, as the colons don't appear aligned... is it possible to find a fix for this?

채택된 답변

Jan
Jan 2018년 6월 23일
편집: Jan 2018년 6월 23일
Pool = {'name : foo', ...
'address : foo', ...
'phone number : foo'};
figure;
menuH = uimenu(gcf, 'Label', 'Your Menu');
h1 = uimenu(menuH, 'Label', ['<HTML><PRE>', Pool{1}]);
h2 = uimenu(menuH, 'Label', ['<HTML><PRE>', Pool{2}]);
h3 = uimenu(menuH, 'Label', ['<HTML><PRE>', Pool{3}]);
  댓글 수: 1
Arabarra
Arabarra 2018년 6월 23일
so easy as that! thanks!

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Walter Roberson
Walter Roberson 2018년 6월 23일
  댓글 수: 1
Arabarra
Arabarra 2018년 6월 23일
편집: Walter Roberson 2018년 6월 23일
that looks like a good approach. Jan's tip saved my day for today, but for big tables (more that 10 fields), I'll need more flexibility, like in the link you indicated. Thanks!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Graphics Object Properties에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by