]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
added newtTextboxReflowed()
authorewt <ewt>
Wed, 18 Feb 1998 19:29:33 +0000 (19:29 +0000)
committerewt <ewt>
Wed, 18 Feb 1998 19:29:33 +0000 (19:29 +0000)
textbox.c

index 640defce0c77dbade58aba001835545bbd4a353e..00f8ecea2641b5caff0bf41ebe42264c00c74534 100644 (file)
--- 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;