From: ewt Date: Thu, 11 Sep 1997 18:17:49 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: r0-12~39 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dab8b9a2fb8ba419943132ee2f3a542f22764da0;p=thirdparty%2Fnewt.git *** empty log message *** --- diff --git a/testgrid.c b/testgrid.c new file mode 100644 index 0000000..879e2cb --- /dev/null +++ b/testgrid.c @@ -0,0 +1,43 @@ +#include +#include +#include +#include + +#include "grid.h" +#include "newt.h" + +int main(void) { + newtComponent b1, b2, b3, b4; + newtComponent answer, f; + newtGrid grid; + + newtInit(); + newtCls(); + newtOpenWindow(2, 2, 40, 15, "first window"); + + b1 = newtButton(-1, -1, "Button 1"); + b2 = newtButton(-1, -1, "Another Button"); + b3 = newtButton(-1, -1, "But, but"); + b4 = newtButton(-1, -1, "But what?"); + + f = newtForm(NULL, NULL, 0); + + grid = newtCreateGrid(2, 2); + newtGridSetField(grid, 0, 0, NEWT_GRID_COMPONENT, b1); + newtGridSetField(grid, 0, 1, NEWT_GRID_COMPONENT, b2); + newtGridSetField(grid, 1, 0, NEWT_GRID_COMPONENT, b3); + newtGridSetField(grid, 1, 1, NEWT_GRID_COMPONENT, b4); + + newtGridPlace(grid, 1, 1); + + newtFormAddComponents(f, b1, b2, b3, b4, NULL); + + answer = newtRunForm(f); + + newtFormDestroy(f); + + newtPopWindow(); + newtFinished(); + + return 0; +}