Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Font size option for msgbox?

1,023 views
Skip to first unread message

ImageAnalyst

unread,
Feb 10, 2011, 12:43:35 PM2/10/11
to
The default font size for msgbox is very small, particularly when
you're operating at high screen resolutions like 1920x1600 or higher.
It looks like it's like 1 point type, well not really, but a capital E
on my screen is only 2 mm high (I measured it). What I would like to
do is have a fontsize option like they do for so many other functions,
such as title(), xlabel(), text(), etc. I'd like to call msgbox like
this:
uiwait(msgbox('These are big letters', 'FontSize', 16));
but unfortunately no such option seems to be available. Why can't
there be a fontsize option like so many other functions have? Is
there any easy workaround (short of developing my own custom GUI to
display things, which I know I can do)?

Sean de

unread,
Feb 10, 2011, 1:18:04 PM2/10/11
to
ImageAnalyst <imagea...@mailinator.com> wrote in message <b8e24b97-6139-494e...@y35g2000prc.googlegroups.com>...

Could you call msgbox with an empty string and then create a static textbox on it with your desired string and fontsize?

It should be a fairly straightforward wrapper for msgbox.

Sean de

unread,
Feb 10, 2011, 2:00:07 PM2/10/11
to


open msgbox.

%Go to line 249 (R2009b);
%Change to whatever value you want and it works. Obviously a bad idea to edit the stock function though.

ImageAnalyst

unread,
Feb 10, 2011, 3:51:13 PM2/10/11
to
On Feb 10, 2:00 pm, "Sean de "

<sean.dewol...@nospamplease.umit.maine.edu> wrote:
> open msgbox.
>
> %Go to line 249 (R2009b);
> %Change to whatever value you want and it works.  Obviously a bad idea to edit the stock function though.
-------------------------------------------------------------------------------
Sean:
Wow, Thanks -- I didn't know msgbox was one we had source code for.
It says
Font.FontUnits='points';
Font.FontSize=get(0,'FactoryUIControlFontSize');
Font.FontName=get(0,'FactoryUIControlFontName');
Font.FontWeight=get(figureHandle,'DefaultUicontrolFontWeight');

I wonder if it can be modified somewhere in this "Factory" so I'm not
modifying MATLAB code? Is it some kind of Java setting on my system
that can be set independently of MATLAB? (Sounds like a question for
Yair !)

By the way my displayed font is (2 mm / 25.5 mm per inch) * 72 points
per inch = 5.67 points. Pretty tiny!
ImageAnalyst

Yair Altman

unread,
Feb 10, 2011, 5:51:03 PM2/10/11
to
ImageAnalyst <imagea...@mailinator.com> wrote...

> Wow, Thanks -- I didn't know msgbox was one we had source code for.
> It says
> Font.FontUnits='points';
> Font.FontSize=get(0,'FactoryUIControlFontSize');
> Font.FontName=get(0,'FactoryUIControlFontName');
> Font.FontWeight=get(figureHandle,'DefaultUicontrolFontWeight');
>
> I wonder if it can be modified somewhere in this "Factory" so I'm not
> modifying MATLAB code? Is it some kind of Java setting on my system
> that can be set independently of MATLAB? (Sounds like a question for Yair !)


While 'FactoryXXX' properties cannot be changed, they all have corresponding 'DefaultXXX' properties that can be modified. For example:
set(0,'DefaultUIControlFontSize',12);

Unfortunately, some internal Matlab functions (tabdlg, inputdlg and msgbox) use 'FactoryXXX' rather than 'DefaultXXX' for some properties. If you ask me, it's a programming oversight by MathWorks. I suggest to go ahead and modify the two offending lines to use 'DefaultXXX' and then set the requested default value in your startup.m file.

Yair Altman
http://UndocumentedMatlab.com

ImageAnalyst

unread,
Feb 12, 2011, 9:47:30 AM2/12/11
to
On Feb 10, 5:51 pm, "Yair Altman" <altmany...@gmailDEL.comDEL> wrote:
> While 'FactoryXXX' properties cannot be changed, they all have corresponding 'DefaultXXX' properties that can be modified. For example:
> set(0,'DefaultUIControlFontSize',12);
>
> Unfortunately, some internal Matlab functions (tabdlg, inputdlg andmsgbox) use 'FactoryXXX' rather than 'DefaultXXX' for some properties. If you ask me, it's a programming oversight by MathWorks. I suggest to go ahead and modify the two offending lines to use 'DefaultXXX' and then set the requested default value in your startup.m file.
>
> Yair Altmanhttp://UndocumentedMatlab.com
-------------------------------------------------------------------------------------
Thanks Yair. I figured it had to be something tricky. I'll try your
suggestion, and I'll also try to remember to put this in as a feature
request for the next version of MATLAB. I would hope it would be easy
and trivial for them to implement.
ImageAnalyst.

0 new messages