font control in uimenu objects

6 vues (au cours des 30 derniers jours)
Arabarra
Arabarra le 23 Juin 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?

Réponse acceptée

Jan
Jan le 23 Juin 2018
Modifié(e) : Jan le 23 Juin 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 commentaire
Arabarra
Arabarra le 23 Juin 2018
so easy as that! thanks!

Connectez-vous pour commenter.

Plus de réponses (1)

Walter Roberson
Walter Roberson le 23 Juin 2018
  1 commentaire
Arabarra
Arabarra le 23 Juin 2018
Modifié(e) : Walter Roberson le 23 Juin 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!

Connectez-vous pour commenter.

Catégories

En savoir plus sur Graphics Object Properties dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by