
Designing for Cross-Platform Compatibility
6-63
Designing for Cross-Platform Compatibility
You can create GUIs that behave more consistently when run on different
platforms by using:
• “Default System Font” on page 6-63
• “Standard Background Color” on page 6-64
• “Cross-Platform Compatible Units” on page 6-66
Default System Font
By default, user interface controls (uicontrols) use the default font for the
platform on which they are running. For example, when displaying your GUI
on PCs, uicontrols uses MS San Serif. When your GUI runs on a different
platform, it uses that computer’s default font. This provides a consistent look
with respect to your GUI and other application GUIs.
If you have set the
FontName property to a named font and want to return to
the default value, you can set the property to the string
default. This ensures
that MATLAB uses the system default at runtime.
From within the GUI M-file, use the set command. For example, if there is a
push button in your GUI and its handle is stored in the
pushbutton1 field of
the
handles structure, then the statement,
set(handles.pushbutton1,'FontName','default')
sets the FontName property to use the system default. You can also use the
Property Inspector to set this property:
Commenti su questo manuale