[Solved] How to set default font in XMLDialog?

Everything else that doesn't fall into one of the other PB categories.
User avatar
Kukulkan
Addict
Addict
Posts: 1352
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

[Solved] How to set default font in XMLDialog?

Post by Kukulkan »

Hi,

I have several windows with a few hundred gadgets using the XMLDialog feature. Now I was asked to set a specific font to all elements if a specific language is used (Chinese). I wonder how to set this for all gadgets without writing hundreds of lines to use SetGadgetFont() on all gadgets one by one? Or is there a way to loop through all gadgets of a dialogue? But this will slow down the dialogue creation, right?

(only cross-platform solutions)

Kukulkan
Last edited by Kukulkan on Fri Nov 03, 2017 12:43 pm, edited 1 time in total.
Fred
Administrator
Administrator
Posts: 16680
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: How to set default font in XMLDialog?

Post by Fred »

You can use SetGadgetFont(#PB_Default, YourFont) before opening any dialog, and it should use it.
User avatar
Kukulkan
Addict
Addict
Posts: 1352
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

Re: How to set default font in XMLDialog?

Post by Kukulkan »

Thanks, this seems to work great. :D
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Re: [Solved] How to set default font in XMLDialog?

Post by davido »

@Fred,
Thank you for the reply: seems logical.
However, on further consideration, I don't think it would have occurred to me.
Perhaps a note could be made in the manual?
DE AA EB
Fred
Administrator
Administrator
Posts: 16680
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: [Solved] How to set default font in XMLDialog?

Post by Fred »

I will, that's a good idea
Post Reply