1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
diff -ruN newt-0.52.2-old/whiptail.c newt-0.52.2/whiptail.c
--- newt-0.52.2-old/whiptail.c 2005-09-21 10:32:03.000000000 +0100
+++ newt-0.52.2/whiptail.c 2005-11-19 12:05:07.000000000 +0000
@@ -57,7 +57,8 @@
"\t--output-fd <fd> output to fd, not stdout\n"
"\t--title <title> display title\n"
"\t--backtitle <backtitle> display backtitle\n"
- "\t--scrolltext force verical scrollbars\n\n"));
+ "\t--scrolltext force verical scrollbars\n"
+ "\t--topleft put window in top-left corner\n\n"));
exit(err ? DLG_ERROR : 0 );
}
@@ -339,6 +340,7 @@
int separateOutput = 0;
int fullButtons = 0;
int outputfd = 2;
+ int topLeft = 0;
FILE *output = stderr;
const char * result;
const char ** selections, ** next;
@@ -367,6 +369,7 @@
{ "separate-output", '\0', 0, &separateOutput, 0 },
{ "title", '\0', POPT_ARG_STRING, &title, 0 },
{ "textbox", '\0', 0, 0, OPT_TEXTBOX },
+ { "topleft", '\0', 0, &topLeft, 0 },
{ "yesno", '\0', 0, 0, OPT_YESNO },
{ "passwordbox", '\0', 0, 0, OPT_PASSWORDBOX },
{ "output-fd", '\0', POPT_ARG_INT, &outputfd, 0 },
@@ -500,8 +503,8 @@
width -= 2;
height -= 2;
- newtOpenWindow((SLtt_Screen_Cols - width) / 2,
- (SLtt_Screen_Rows - height) / 2, width, height, title);
+ newtOpenWindow(topLeft ? 1 : (SLtt_Screen_Cols - width) / 2,
+ topLeft ? 1 : (SLtt_Screen_Rows - height) / 2, width, height, title);
if (backtitle)
newtDrawRootText(0, 0, backtitle);
|