Page 1 of 1

[Solved] How to set default font in XMLDialog?

Posted: Fri Nov 03, 2017 10:22 am
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

Re: How to set default font in XMLDialog?

Posted: Fri Nov 03, 2017 11:12 am
by Fred
You can use SetGadgetFont(#PB_Default, YourFont) before opening any dialog, and it should use it.

Re: How to set default font in XMLDialog?

Posted: Fri Nov 03, 2017 12:42 pm
by Kukulkan
Thanks, this seems to work great. :D

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

Posted: Fri Nov 03, 2017 1:40 pm
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?

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

Posted: Fri Nov 03, 2017 2:54 pm
by Fred
I will, that's a good idea