]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
added newtAddComponentsToForm() r0-21
authorewt <ewt>
Fri, 16 Jan 1998 21:44:34 +0000 (21:44 +0000)
committerewt <ewt>
Fri, 16 Jan 1998 21:44:34 +0000 (21:44 +0000)
grid.c
newt.h
newt.spec

diff --git a/grid.c b/grid.c
index 609f73aac5daed743419c89b9e00df8133b11374..19c5efae2d086c24dc30bfe9c6ce58e65ec5e894 100644 (file)
--- a/grid.c
+++ b/grid.c
@@ -245,3 +245,18 @@ void newtGridWrappedWindow(newtGrid grid, char * title) {
     newtCenteredWindow(width + 2, height + 2, title);
     newtGridPlace(grid, 1, 1);
 }
+
+void newtGridAddComponentsToForm(newtGrid grid, newtComponent form, 
+                                int recurse) {
+    int row, col;
+
+    for (col = 0; col < grid->cols; col++) {
+       for (row = 0; row < grid->rows; row++) {
+           if (grid->fields[col][row].type == NEWT_GRID_SUBGRID && recurse)
+               newtGridAddComponentsToForm(grid->fields[col][row].u.grid,
+                                           form, 1);
+           else
+               newtFormAddComponent(form, grid->fields[col][row].u.co);
+       }
+    }
+}
diff --git a/newt.h b/newt.h
index d3f011279a0cd9735f4cdb75d03b63aa80b31ae0..d1b1db6b5d039f295575e60e889adf54d350b5f0 100644 (file)
--- a/newt.h
+++ b/newt.h
@@ -253,6 +253,8 @@ void newtGridPlace(newtGrid grid, int left, int top);
 void newtGridFree(newtGrid grid, int recurse);
 void newtGridGetSize(newtGrid grid, int * width, int * height);
 void newtGridWrappedWindow(newtGrid grid, char * title);
+void newtGridAddComponentsToForm(newtGrid grid, newtComponent form, 
+                                int recurse);
 
 /* convienve */
 newtGrid newtButtonBar(char * button1, newtComponent * b1comp, ...);
index 4fa8457296554a19de9635705fc81d14ee22f9d5..7d70781c576e00e199deb76fb2acf8deaa956b87 100644 (file)
--- a/newt.spec
+++ b/newt.spec
@@ -50,6 +50,15 @@ rm -rf $RPM_BUILD_ROOT
 
 %changelog
 
+* Fri Jan 16 1998 Erik Troan <ewt@redhat.com>
+
+- added changes from Bruce Perens
+    - small cleanups
+    - lets whiptail automatically resize windows
+- the order of placing a grid and adding components to a form no longer
+  matters
+- added newtGridAddComponentsToForm()
+
 * Wed Oct 08 1997 Erik Troan <ewt@redhat.com>
 
 - added newtWinTernary()