Page 1 of 1

Posted: Wed Jan 30, 2002 11:23 pm
by BackupUser
Restored from previous forum. Originally posted by PB.

Hi, I'm using this code to change the font of a gadget:

Code: Select all

LoadFont(1,"Pooh",12) : SetGadgetFont(FontID())
fraOptions_hWnd=Frame3DGadget(#fraOptions,8,8,338,113,"Options",0)
It works perfectly, but how do I then reset the font back to the system default
so that none of the following gadgets, created afterwards, have the Pooh font?
All I want is for this FrameGadget to have the Pooh font, and all the gadgets
inside it should be the system default.


PB - Registered PureBasic Coder

Edited by - PB on 30 January 2002 23:26:12

Posted: Thu Jan 31, 2002 12:52 am
by BackupUser
Restored from previous forum. Originally posted by fred.

Try SetGadgetFont(GetStockObject_(#ANSI_VAR_FONT)). Anyway, I will change the command, so a SetGadgetFont(0) will reset the font to previous one.

Fred - AlphaSND

Posted: Thu Jan 31, 2002 10:39 am
by BackupUser
Restored from previous forum. Originally posted by PB.
Try SetGadgetFont(GetStockObject_(#ANSI_VAR_FONT)). Anyway, I will change the command, so a SetGadgetFont(0) will reset the font to previous one.
The ANSI thing worked, so thanks Fred! Good idea about the (0) parameter for
the future, too. Side-note: Any way to set the style of the font (bold, italic,
and so on)? I'll have to play with the GetStockObject API and see...


PB - Registered PureBasic Coder