From: ewt Date: Sun, 5 Apr 1998 16:55:52 +0000 (+0000) Subject: 1) anchor text on left in basic window X-Git-Tag: r0-23~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9eec2427998ef76bb038f2b149ff017722ae8f62;p=thirdparty%2Fnewt.git 1) anchor text on left in basic window 2) add a scrollbar to newtWinMessage() when the text is too long --- diff --git a/windows.c b/windows.c index e0bc9ef..99a65e2 100644 --- a/windows.c +++ b/windows.c @@ -13,6 +13,7 @@ static void * newtvwindow(char * title, char * button1, char * button2, char * buf = NULL; int size = 0; int i = 0; + int scroll = 0; int width, height; char * flowedText; newtGrid grid, buttonGrid; @@ -31,7 +32,11 @@ static void * newtvwindow(char * title, char * button1, char * button2, } free(buf); - t = newtTextbox(-1, -1, width, height, NEWT_TEXTBOX_WRAP); + if (height > 12) { + height = 12; + scroll = NEWT_FLAG_SCROLL; + } + t = newtTextbox(-1, -1, width, height, NEWT_TEXTBOX_WRAP | scroll); newtTextboxSetText(t, flowedText); free(flowedText); @@ -243,7 +248,7 @@ int newtWinEntries(char * title, char * text, int suggestedWidth, int flexDown, grid = newtCreateGrid(1, 3); form = newtForm(NULL, 0, 0); newtGridSetField(grid, 0, 0, NEWT_GRID_COMPONENT, textw, - 0, 0, 0, 0, 0, 0); + 0, 0, 0, 0, NEWT_ANCHOR_LEFT, 0); newtGridSetField(grid, 0, 1, NEWT_GRID_SUBGRID, subgrid, 0, 1, 0, 0, 0, 0); newtGridSetField(grid, 0, 2, NEWT_GRID_SUBGRID, buttonBar,