From: msw Date: Tue, 3 Apr 2001 00:23:34 +0000 (+0000) Subject: fix flashing X-Git-Tag: r0-50-22~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=add984c18ea735064ee8da468a208d080e85fd62;p=thirdparty%2Fnewt.git fix flashing --- diff --git a/textbox.c b/textbox.c index ff0a64c..dc42dc5 100644 --- a/textbox.c +++ b/textbox.c @@ -303,6 +303,8 @@ void newtTextboxSetText(newtComponent co, const char * text) { addLine(co, start, strlen(start)); free(expanded); + + newtTrashScreen(); } /* This assumes the buffer is allocated properly! */ @@ -330,8 +332,6 @@ static void textboxDraw(newtComponent c) { SLsmg_set_color(NEWT_COLORSET_TEXTBOX); - newtTrashScreen(); - for (i = 0; (i + tb->topLine) < tb->numLines && i < c->height; i++) { newtGotorc(c->top + i, c->left); SLsmg_write_string(tb->lines[i + tb->topLine]); @@ -346,6 +346,7 @@ static struct eventResult textboxEvent(newtComponent co, er.result = ER_IGNORED; if (ev.when == EV_EARLY && ev.event == EV_KEYPRESS && tb->sb) { + newtTrashScreen(); switch (ev.u.key) { case NEWT_KEY_UP: if (tb->topLine) tb->topLine--;