font control in uimenu objects

6 次查看(过去 30 天)
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 个)

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