]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
- add topleft option (patch from debian)
authormlichvar <mlichvar>
Thu, 12 Oct 2006 14:31:16 +0000 (14:31 +0000)
committermlichvar <mlichvar>
Thu, 12 Oct 2006 14:31:16 +0000 (14:31 +0000)
whiptail.1
whiptail.c

index 1d2e63d243608b7e3cc79d3a40e183fadd82ab9d..8dc50b7e8698c74ce191ea073d50827f28a5e1f1 100644 (file)
@@ -1,4 +1,4 @@
-.TH WHIPTAIL 1 "20 September 2004" "Whiptail Version 0.51.6"
+.TH WHIPTAIL 1 "12 October 2006" "Whiptail Version 0.52.3"
 .SH NAME
 whiptail \- display dialog boxes from shell scripts
 .SH SYNOPSIS
@@ -40,6 +40,9 @@ whiptail \- display dialog boxes from shell scripts
 [
 .B \-\-scrolltext
 ]
+[
+.B \-\-topleft
+]
 .B box-options
 .SH DESCRIPTION
 .B whiptail
@@ -105,6 +108,9 @@ string to be displayed on the backdrop, at the top of the screen.
 .BI \-\-scrolltext
 Force the display of a vertical scrollbar.
 .TP
+.BI \-\-topleft
+Put window in top-left corner.
+.TP
 .B Box Options
 .TP
 .BI \-\-yesno " text height width"
index 8a821b7ee8e64acb5f003a7c95e9391cfac5acb4..b036170cc11081fdce668059ee9f53825b0d380c 100644 (file)
@@ -48,7 +48,7 @@ static void usage(int err) {
               "\t--gauge <text> <height> <width> <percent>\n"
               "Options: (depend on box-option)\n"
               "\t--clear                               clear screen on exit\n"
-              "\t-defaultno                    default no button\n"    
+              "\t--defaultno                   default no button\n"    
               "\t--default-item <string>               set default string\n"
               "\t--fb                          use full buttons\n"
               "\t--nocancel                    no cancel button\n"
@@ -57,7 +57,8 @@ static void usage(int err) {
               "\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 main(int argc, const char ** argv) {
     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 @@ int main(int argc, const char ** argv) {
            { "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 },
@@ -501,8 +504,8 @@ int main(int argc, const char ** argv) {
     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);