]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
fixed major bug in newtWinChoice()
authorewt <ewt>
Fri, 12 Sep 1997 16:19:08 +0000 (16:19 +0000)
committerewt <ewt>
Fri, 12 Sep 1997 16:19:08 +0000 (16:19 +0000)
testgrid.c
windows.c

index 65f930d0a4390e060c4c2303cbb7394c1bed4123..5c5b78b320204f5810a436923a908190087959ae 100644 (file)
@@ -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();
 
index d846b50fb58db94114c9d679722a09bc0b0c0af0..5070de3d535dadc20c5ce8bc2700da29c2fb8c2a 100644 (file)
--- 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);