From: ewt Date: Tue, 28 Apr 1998 06:47:47 +0000 (+0000) Subject: max width and max height of row/col wasn't calculated properly X-Git-Tag: r0-24~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c8fa0ee7c0147454fcb29c23e6e10dff60c925c5;p=thirdparty%2Fnewt.git max width and max height of row/col wasn't calculated properly --- diff --git a/grid.c b/grid.c index e2924b2..66d8806 100644 --- a/grid.c +++ b/grid.c @@ -112,8 +112,8 @@ static void shuffleGrid(newtGrid grid, int left, int top, int set) { j += field->padLeft + field->padRight; - i += j; if (j > widths[col]) widths[col] = j; + i += widths[col]; } if (i > minWidth) minWidth = i; @@ -136,8 +136,8 @@ static void shuffleGrid(newtGrid grid, int left, int top, int set) { j += field->padTop + field->padBottom; - i += j; if (j > heights[row]) heights[row] = j; + i += heights[row]; } if (i > minHeight) minHeight = i; diff --git a/testgrid.c b/testgrid.c index c7497fa..87cbb1f 100644 --- a/testgrid.c +++ b/testgrid.c @@ -25,9 +25,7 @@ int main(void) { newtInit(); newtCls(); - newtOpenWindow(2, 2, 40, 15, "first window"); - - b1 = newtButton(-1, -1, "Button 1"); + b1 = newtCheckbox(-1, -1, "An pretty long checkbox for testing", ' ', NULL, NULL); b2 = newtButton(-1, -1, "Another Button"); b3 = newtButton(-1, -1, "But, but"); b4 = newtButton(-1, -1, "But what?"); @@ -44,7 +42,7 @@ int main(void) { newtFormAddComponents(f, b1, b2, b3, b4, NULL); - newtGridPlace(grid, 1, 1); + newtGridWrappedWindow(grid, "first window"); answer = newtRunForm(f);