diff options
Diffstat (limited to 'src/libui_sdl/libui/test/page8.c')
-rw-r--r-- | src/libui_sdl/libui/test/page8.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/libui_sdl/libui/test/page8.c b/src/libui_sdl/libui/test/page8.c new file mode 100644 index 0000000..7d85556 --- /dev/null +++ b/src/libui_sdl/libui/test/page8.c @@ -0,0 +1,46 @@ +// 22 december 2015 +#include "test.h" + +static void onListFonts(uiButton *b, void *data) +{ + uiDrawFontFamilies *ff; + char *this; + int i, n; + + uiMultilineEntrySetText(uiMultilineEntry(data), ""); + ff = uiDrawListFontFamilies(); + n = uiDrawFontFamiliesNumFamilies(ff); + for (i = 0; i < n; i++) { + this = uiDrawFontFamiliesFamily(ff, i); + uiMultilineEntryAppend(uiMultilineEntry(data), this); + uiMultilineEntryAppend(uiMultilineEntry(data), "\n"); + uiFreeText(this); + } + uiDrawFreeFontFamilies(ff); +} + +uiBox *makePage8(void) +{ + uiBox *page8; + uiGroup *group; + uiBox *vbox; + uiMultilineEntry *me; + uiButton *button; + + page8 = newHorizontalBox(); + + group = newGroup("Font Families"); + uiBoxAppend(page8, uiControl(group), 1); + + vbox = newVerticalBox(); + uiGroupSetChild(group, uiControl(vbox)); + + me = uiNewMultilineEntry(); + uiBoxAppend(vbox, uiControl(me), 1); + + button = uiNewButton("List Font Families"); + uiButtonOnClicked(button, onListFonts, me); + uiBoxAppend(vbox, uiControl(button), 0); + + return page8; +} |