From 8de669b8333f018dba78de6447d569cf9670ec26 Mon Sep 17 00:00:00 2001 From: ewt Date: Jan 16 1998 21:44:34 +0000 Subject: added newtAddComponentsToForm() --- diff --git a/grid.c b/grid.c index 609f73a..19c5efa 100644 --- 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 d3f0112..d1b1db6 100644 --- 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, ...); diff --git a/newt.spec b/newt.spec index 4fa8457..7d70781 100644 --- a/newt.spec +++ b/newt.spec @@ -50,6 +50,15 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Fri Jan 16 1998 Erik Troan + +- 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 - added newtWinTernary()