Mercurial > dwindows
diff os2/dw.c @ 1075:3d117071a50b
Renamed Mac _dw_default_font() to dw_font_set_default() and added it on OS/2 and Windows.
Function added to the public export list... GTK2/3 support will be added shortly.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sun, 26 Jun 2011 02:07:49 +0000 |
parents | 240bd5fb8453 |
children | 34f1d6f5f1c3 |
line wrap: on
line diff
--- a/os2/dw.c Sat Jun 25 03:16:40 2011 +0000 +++ b/os2/dw.c Sun Jun 26 02:07:49 2011 +0000 @@ -3669,7 +3669,9 @@ desktop = WinQueryDesktopWindow(dwhab, NULLHANDLE); if(!IS_WARP4()) - DefaultFont = "8.Helv"; + DefaultFont = strdup("8.Helv"); + else + DefaultFont = strdup(DefaultFont); /* This is a window that hangs around as long as the * application does and handles menu messages. @@ -4131,6 +4133,19 @@ } /* + * Sets the default font used on text based widgets. + * Parameters: + * fontname: Font name in Dynamic Windows format. + */ +void API dw_font_set_default(char *fontname) +{ + char *oldfont = DefaultFont; + + DefaultFont = strdup(fontname); + free(oldfont); +} + +/* * Sets the font used by a specified window (widget) handle. * Parameters: * handle: The window (widget) handle.