Setting default widget font?

in PhAB, is it possible to set the default widget font to anything other
than Helvetica?

Meredith Dill
mdill@aseco.com

Hi Meredith,

  • Visit /qnx4/phtk/appbuilder
  • edit pal file “ptpalette.pal”
  • find label widget declaration (should be begin around line 123 for PtLabel
    widget)
  • find declaration “r=Pt_ARG_TEXT_FONT,…”
  • replace “helv12” with your needs.

Should work after restarting PhAB.
regards
/martin

Meredith Dill <mdill@aseco.com> schrieb in im Newsbeitrag:
3A081397.D70665A2@aseco.com

in PhAB, is it possible to set the default widget font to anything other
than Helvetica?

Meredith Dill
mdill@aseco.com

Martin Koehler <software@pcds.de> wrote:

  • Visit /qnx4/phtk/appbuilder
  • edit pal file “ptpalette.pal”
  • find label widget declaration (should be begin around line 123 for PtLabel
    widget)
  • find declaration “r=Pt_ARG_TEXT_FONT,…”
  • replace “helv12” with your needs.

This is a very bad idea. By doing it, you are not changing the default
– you’re just lying to PhAB about what the default is. As a result,
PhAB will sometimes decide that it’s not necessary to change the
widget’s font because it’s already set to what PhAB thinks is the
default, while it’s really set to helv12. This will prevent you from
being able to change the font from helv12 to your “default” without
using tricks. And any new widgets will display helv12 even though PhAB
will think they’re displaying your “default” font.

Strictly speaking, you can’t change a widget’s default font without
recompiling the widget. But you can tell PhAB to override it with a
different font whenever you’re creating a new widget in your app. This
is also done by editing PhAB palette file, but in the “d=” line rather
than the “r=” line. For details, search the docs for “Default values
(d=)”.

BTW Keep in mind that PhAB palette files weren’t really intended to be
modify by users. Your changes may get overwritten when you install the
next version of Photon – you will have to reapply them after.

\

Wojtek Lerch (wojtek@qnx.com) QNX Software Systems Ltd.

Thanks! This sounds like exactly what I want… The QC guys want us to
use Arial as the default and I really wasn’t looking forward to manually
changing everything whenever I create a new widget.

Meredith

Wojtek Lerch wrote:

Martin Koehler <> software@pcds.de> > wrote:

  • Visit /qnx4/phtk/appbuilder
  • edit pal file “ptpalette.pal”
  • find label widget declaration (should be begin around line 123 for PtLabel
    widget)
  • find declaration “r=Pt_ARG_TEXT_FONT,…”
  • replace “helv12” with your needs.

This is a very bad idea. By doing it, you are not changing the default
– you’re just lying to PhAB about what the default is. As a result,
PhAB will sometimes decide that it’s not necessary to change the
widget’s font because it’s already set to what PhAB thinks is the
default, while it’s really set to helv12. This will prevent you from
being able to change the font from helv12 to your “default” without
using tricks. And any new widgets will display helv12 even though PhAB
will think they’re displaying your “default” font.

Strictly speaking, you can’t change a widget’s default font without
recompiling the widget. But you can tell PhAB to override it with a
different font whenever you’re creating a new widget in your app. This
is also done by editing PhAB palette file, but in the “d=” line rather
than the “r=” line. For details, search the docs for “Default values
(d=)”.

BTW Keep in mind that PhAB palette files weren’t really intended to be
modify by users. Your changes may get overwritten when you install the
next version of Photon – you will have to reapply them after.


Wojtek Lerch (> wojtek@qnx.com> ) QNX Software Systems Ltd.