From: ewt Date: Fri, 12 Sep 1997 16:19:08 +0000 (+0000) Subject: fixed major bug in newtWinChoice() X-Git-Tag: r0-12~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cccf98b716fa8528f562a0b8a224206bc1ea5b6a;p=thirdparty%2Fnewt.git fixed major bug in newtWinChoice() --- diff --git a/testgrid.c b/testgrid.c index 65f930d..5c5b78b 100644 --- a/testgrid.c +++ b/testgrid.c @@ -73,6 +73,7 @@ int main(void) { newtPopWindow(); newtWinMessage("Simple", "Ok", "This is a simple message window"); + newtWinChoice("Simple", "Ok", "Cancel", "This is a simple choice window"); newtFinished(); diff --git a/windows.c b/windows.c index d846b50..5070de3 100644 --- a/windows.c +++ b/windows.c @@ -39,7 +39,7 @@ static int newtvwindow(char * title, char * button1, char * button2, if (button2) { b2 = newtButton(-1, -1, button2); buttonGrid = newtCreateGrid(2, 1); - newtGridSetField(buttonGrid, 1, 0, NEWT_GRID_COMPONENT, button2, + newtGridSetField(buttonGrid, 1, 0, NEWT_GRID_COMPONENT, b2, 1, 0, 0, 0, 0, 0); } else { buttonGrid = newtCreateGrid(1, 1); @@ -57,6 +57,9 @@ static int newtvwindow(char * title, char * button1, char * button2, f = newtForm(NULL, NULL, 0); newtFormAddComponents(f, t, b1, NULL); + if (button2) + newtFormAddComponent(f, b2); + answer = newtRunForm(f); newtGridFree(grid, 1);