MATLAB Answers

font control in uimenu objects

4 views (last 30 days)
Arabarra
Arabarra on 23 Jun 2018
Edited: Walter Roberson on 23 Jun 2018
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?

  0 Comments

Sign in to comment.

Accepted Answer

Jan
Jan on 23 Jun 2018
Edited: Jan on 23 Jun 2018
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 Comment

Arabarra
Arabarra on 23 Jun 2018
so easy as that! thanks!

Sign in to comment.

More Answers (1)

Walter Roberson
Walter Roberson on 23 Jun 2018

  1 Comment

Arabarra
Arabarra on 23 Jun 2018
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!

Sign in to comment.

Sign in to answer this question.