swk

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

commit b17b120225c3ac79bd7fb21908e698e9a3c76821
parent b8b4fc7a82b093b2f9dae1ea19dbc74d5747adde
Author: pancake <pancake@nopcode.org>
Date:   Sun, 22 Aug 2010 08:06:19 +0200

drop useless check in gi_x11. dc_init ensures non-null pointer
add support for floating point arithmetics to t/calc
Diffstat:
TODO | 1+
gi_x11.c | 3+--
t/calc.c | 2++
3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/TODO b/TODO @@ -1,5 +1,6 @@ TODO ==== + * how to schedule a function to be executed in N ns? * Add thresold to detect click and pan * implement a top bar to mark selected column * support multiline text widget diff --git a/gi_x11.c b/gi_x11.c @@ -50,8 +50,7 @@ swk_gi_init(SwkWindow *w) { char buf[128]; if(first) { first = 0; - if (!(dc = dc_init())) - return 0; + dc = dc_init(); for(i=0;i<ColorLast;i++) { sprintf(buf, "#%06x", colors[i]); col[i] = dc_color(dc, buf); diff --git a/t/calc.c b/t/calc.c @@ -24,6 +24,7 @@ static void button(SwkEvent *e) { pd = popen(buffer2, "r"); fgets(buffer, sizeof(buffer), pd); bufferi = strlen(buffer)-1; + buffer[bufferi] = 0; pclose(pd); } break; @@ -64,6 +65,7 @@ static SwkBox contents[] = { { .cb=button, .text="*" }, SWK_BOX_NEWLINE(1), { .cb=swk_separator }, + { .cb=button, .text="." }, { .cb=button, .text="=" }, { .cb=NULL } };