swk

static widget kit
git clone git://git.suckless.org/swk
Log | Files | Refs | README | LICENSE

commit 2a8c188e51547e3dea8dc80465bec44b8a26a153
parent 496e2221c65c0c2d568d6a470abc1cef654e595a
Author: pancake <pancake@nopcode.org>
Date:   Wed, 21 Apr 2010 03:35:01 +0200

fix test program
reduce font size to 14px
swk_fit_row is now static
Diffstat:
gi_sdl.c | 4++--
swk.c | 4++--
swk.h | 1-
test.c | 9++-------
4 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/gi_sdl.c b/gi_sdl.c @@ -8,7 +8,7 @@ #define TFCOLOR 0xff,0xff,0xff #define FONTNAME "Inconsolata.otf" //#define FONTSIZE 16 -#define FONTSIZE 32 +#define FONTSIZE 14 #define FS FONTSIZE #define BPP 32 /* --- */ @@ -64,7 +64,7 @@ swk_gi_init(SwkWindow *w) { if (font == NULL) { fprintf(stderr, "Cannot open font '%s'\n", FONTNAME); return 0; - } + } //else TTF_SetFontStyle(font, TTF_STYLE_BOLD); return 1; } diff --git a/swk.c b/swk.c @@ -47,8 +47,8 @@ swk_loop() { swk_event_handle(e); } while (!e || e->type != EQuit); } -void -swk_fit_row(SwkBox *a, SwkBox *b, int y) { + +static void swk_fit_row(SwkBox *a, SwkBox *b, int y) { int count, x = 0; SwkBox *btmp; count = 0; diff --git a/swk.h b/swk.h @@ -65,7 +65,6 @@ void swk_update(); void swk_exit(); void swk_fit(); void swk_loop(); -void swk_fit_row(SwkBox *a, SwkBox *b, int y); SwkEvent * swk_event(); void swk_event_handle(SwkEvent *e); int swk_gi_has_event(); diff --git a/test.c b/test.c @@ -8,7 +8,7 @@ static SwkBox helloworld[]; static void mybutton(SwkEvent *e) { if (e->type == EClick) { sprintf(text, "Do it again %d times\n", count); - helloworld[0].text = text; + helloworld[1].text = text; if (count-- == 0) swk_exit(); } @@ -21,13 +21,8 @@ static SwkBox helloworld[] = { { .cb=swk_label, .text="Press a button", }, { SWK_NEWLINE(2) }, { .cb=mybutton, .text="yes" }, - { .cb=swk_filler, }, { .cb=mybutton, .text="no" }, -#if 0 - { SWK_NEWLINE(1) }, - { .cb=mybutton, .text="yes" }, - { .cb=mybutton, .text="no" }, -#endif + { .cb=swk_filler, }, { SWK_NEWLINE(5) }, { .cb=swk_label, .text="--swktest", }, { .cb=NULL }