From: ewt Date: Wed, 18 Feb 1998 19:29:33 +0000 (+0000) Subject: added newtTextboxReflowed() X-Git-Tag: r0-22~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f1d6b549ea777868cd0c6e4150064610dcf832e4;p=thirdparty%2Fnewt.git added newtTextboxReflowed() --- diff --git a/textbox.c b/textbox.c index 640defc..00f8ece 100644 --- a/textbox.c +++ b/textbox.c @@ -39,6 +39,22 @@ int newtTextboxGetNumLines(newtComponent co) { return (tb->numLines); } +newtComponent newtTextboxReflowed(int left, int top, char * text, int width, + int flexDown, int flexUp, int flags) { + newtComponent co; + char * reflowedText; + int actWidth, actHeight; + + reflowedText = newtReflowText(text, width, flexDown, flexUp, + &actWidth, &actHeight); + + co = newtTextbox(-1, -1, actWidth, actHeight, NEWT_TEXTBOX_WRAP); + newtTextboxSetText(co, reflowedText); + free(reflowedText); + + return co; +} + newtComponent newtTextbox(int left, int top, int width, int height, int flags) { newtComponent co; struct textbox * tb;