]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
*** empty log message ***
authorewt <ewt>
Fri, 12 Sep 1997 15:50:03 +0000 (15:50 +0000)
committerewt <ewt>
Fri, 12 Sep 1997 15:50:03 +0000 (15:50 +0000)
testgrid.c

index fb49eb0ac374249783d51000d040e1c19ad91848..65f930d0a4390e060c4c2303cbb7394c1bed4123 100644 (file)
@@ -9,6 +9,8 @@ int main(void) {
     newtComponent b1, b2, b3, b4;
     newtComponent answer, f, t;
     newtGrid grid, subgrid;
+    char * flowedText;
+    int textWidth, textHeight;
 
     newtInit();
     newtCls();
@@ -38,11 +40,17 @@ int main(void) {
 
     newtPopWindow();
 
-    t = newtTextbox(-1, -1, 40, 4, NEWT_FLAG_WRAP);
-    newtTextboxSetText(t, "This is a quite a bit of text. It is 40 "
-                         "columns long, so some wrapping should be "
-                         "done. Did you know that the quick, brown "
-                         "fox jumped over the lazy dog?");
+    flowedText = newtReflowText("This is a quite a bit of text. It is 40 "
+                               "columns long, so some wrapping should be "
+                               "done. Did you know that the quick, brown "
+                               "fox jumped over the lazy dog?\n\n"
+                               "In other news, it's pretty important that we "
+                               "can properly force a line break.",
+                               40, 5, 5, &textWidth, &textHeight);
+    t = newtTextbox(-1, -1, textWidth, textHeight, NEWT_FLAG_WRAP);
+    newtTextboxSetText(t, flowedText);
+    free(flowedText);
+
     
     b1 = newtButton(-1, -1, "Okay");
     b2 = newtButton(-1, -1, "Cancel");
@@ -62,6 +70,10 @@ int main(void) {
     newtFormAddComponents(f, b1, t, b2, NULL);
     answer = newtRunForm(f);
 
+    newtPopWindow();
+
+    newtWinMessage("Simple", "Ok", "This is a simple message window");
+
     newtFinished();
 
     return 0;