661
664
Like \fBcomparguments\fP, but for the \fB_values\fP function\&.
665
.SH "THE ZSH/CURSES MODULE"
666
.\" Yodl file: Zsh/mod_curses.yo
668
The \fBzsh/curses\fP module makes available one builtin command and
669
various parameters\&.
676
\fBzcurses\fP \fBinit\fP
679
\fBzcurses\fP \fBend\fP
682
\fBzcurses\fP \fBaddwin\fP \fItargetwin\fP \fInlines\fP \fIncols\fP \fIbegin_y\fP \fIbegin_x\fP [ \fIparentwin\fP ]
685
\fBzcurses\fP \fBdelwin\fP \fItargetwin\fP
688
\fBzcurses\fP \fBrefresh\fP [ \fItargetwin\fP \&.\&.\&. ]
691
\fBzcurses\fP \fBtouch\fP \fItargetwin\fP \&.\&.\&.
694
\fBzcurses\fP \fBmove\fP \fItargetwin\fP \fInew_y\fP \fInew_x\fP
697
\fBzcurses\fP \fBclear\fP \fItargetwin\fP [ \fBredraw\fP | \fBeol\fP | \fBbot\fP ]
700
\fBzcurses\fP \fBlocation\fP \fItargetwin\fP \fIarray\fP
703
\fBzcurses\fP \fBchar\fP \fItargetwin\fP \fIcharacter\fP
706
\fBzcurses\fP \fBstring\fP \fItargetwin\fP \fIstring\fP
709
\fBzcurses\fP \fBborder\fP \fItargetwin\fP \fIborder\fP (
712
\fBzcurses\fP \fBattr\fP \fItargetwin\fP [ \fI{+/\-}attribute\fP | \fIfg_col\fP\fB/\fP\fIbg_col\fP ] [\&.\&.\&.]
715
\fBzcurses\fP \fBscroll\fP [ \fBon\fP | \fBoff\fP | {+/\-}\fIlines\fP ]
718
\fBzcurses\fP \fBinput\fP \fItargetwin\fP [ \fIparam\fP [ \fIkpparm\fP ] ]
721
\fBzcurses\fP \fBtimeout\fP \fItargetwin\fP \fIintval\fP
722
Manipulate curses windows\&. All uses of this command should be
723
bracketed by `\fBzcurses init\fP\&' to initialise use of curses, and
724
`\fBzcurses end\fP\&' to end it; omitting `\fBzcurses end\fP' can cause
725
the terminal to be in an unwanted state\&.
728
With \fBaddwin\fP, create a window with \fInlines\fP lines and \fIncols\fP columns\&.
729
Its upper left corner will be placed at row \fIbegin_y\fP and column
730
\fIbegin_x\fP of the screen\&. \fItargetwin\fP is a string and refers
731
to the name of a window that is not currently assigned\&. Note
732
in particular the curses convention that vertical values appear
733
before horizontal values\&.
735
If \fBaddwin\fP is given an existing window as the final argument, the new
736
window is created as a subwindow of \fIparentwin\fP\&. This differs from an
737
ordinary new window in that the memory of the window contents is shared
738
with the parent\&'s memory\&. Subwindows must be deleted before their parent\&.
739
Note that the coordinates of subwindows are relative to the screen, not
740
the parent, as with other windows
742
Use \fBdelwin\fP to delete a window created with \fBaddwin\fP\&. Note
743
that \fBend\fP does \fInot\fP implicitly delete windows, and that
744
\fBdelwin\fP does not erase the screen image of the window\&.
746
The window corresponding to the full visible screen is called
747
\fBstdscr\fP; it always exists after `\fBzcurses init\fP\&' and cannot
748
be delete with \fBdelwin\fP\&.
750
The \fBrefresh\fP command will refresh window \fItargetwin\fP; this is
751
necessary to make any pending changes (such as characters you have
752
prepared for output with \fBchar\fP) visible on the screen\&. \fBrefresh\fP
753
without an argument causes the screen to be cleared and redrawn\&.
754
If multiple windows are given, the screen is updated once at the end\&.
756
The \fBtouch\fP command marks the \fItargetwin\fPs listed as changed\&.
757
This is necessary before \fBrefresh\fPing windows if a window that
758
was in front of another window (which may be \fBstdscr\fP) is deleted\&.
760
\fBmove\fP moves the cursor position in \fItargetwin\fP to new coordinates
761
\fInew_y\fP and \fInew_x\fP\&.
763
\fBclear\fP erases the contents of \fItargetwin\fP\&. One (and no more than one)
764
of three options may be specified\&. With the option \fBredraw\fP,
765
in addition the next \fBrefresh\fP of \fItargetwin\fP will cause the screen to be
766
cleared and repainted\&. With the option \fBeol\fP, \fItargetwin\fP is only
767
cleared to the end of the current cursor line\&. With the option
768
\fBbot\fP, \fItargetwin\fP is cleared to the end of the window, i\&.e
769
everything to the right and below the cursor is cleared\&.
771
\fBlocation\fP writes various positions associated with \fItargetwin\fP
772
into the array named \fIarray\fP\&.
777
The y and x coordinates of the cursor relative to the top left
781
The y and x coordinates of the top left of \fItargetwin\fP on the
785
The size of \fItargetwin\fP in y and x dimensions\&.
788
Outputting characters and strings are achieved by \fBchar\fP and \fBstring\fP
791
To draw a border around window \fItargetwin\fP, use \fBborder\fP\&. Note
792
that the border is not subsequently handled specially: in other words,
793
the border is simply a set of characters output at the edge of the
794
window\&. Hence it can be overwritten, can scroll off the window, etc\&.
796
\fBattr\fP will set \fItargetwin\fP\&'s attributes or foreground/background
797
color pair for any successive character output\&. Each \fIattribute\fP
798
given on the line may be prepended by a \fB+\fP to set or a \fB\-\fP to
799
unset that attribute; \fB+\fP is assumed if absent\&. The attributes
800
supported are \fBblink\fP, \fBbold\fP, \fBdim\fP, \fBreverse\fP, \fBstandout\fP,
801
and \fBunderline\fP\&.
803
Each \fIfg_col\fP\fB/\fP\fIbg_col\fP attribute (to be read as
804
`\fIfg_col\fP on \fIbg_col\fP\&') sets the foreground and background color
805
for character output\&. The color \fBdefault\fP is sometimes available
806
(in particular if the library is ncurses), specifying the foreground
807
or background color with which the terminal started\&. The color pair
808
\fBdefault/default\fP is always available\&.
810
\fBscroll\fP can be used with \fBon\fP or \fBoff\fP to enabled or disable
811
scrolling of a window when the cursor would otherwise move below the
812
window due to typing or output\&. It can also be used with a positive
813
or negative integer to scroll the window up or down the given number
814
of lines without changing the current cursor position (which therefore
815
appears to move in the opposite direction relative to the window)\&.
816
In the second case, if scrolling is \fBoff\fP it is temporarily turned \fBon\fP
817
to allow the window to be scrolled\&.
819
\fBinput\fP reads a single character from the window without echoing
820
it back\&. If \fIparam\fP is supplied the character is assigned to the
821
parameter \fIparam\fP, else it is assigned to the parameter \fIREPLY\fP\&.
822
If both \fIparam\fP and \fIkpparam\fP are supplied, the key is read
823
in `keypad\&' mode\&. In this mode special keys such as function keys
824
and arrow keys return the name of the key in the parameter \fIkpparam\fP\&.
825
The key names are the macros defined in the \fBcurses\&.h\fP or \fBncurses\&.h\fP
826
with the prefix `\fBKEY_\fP\&' removed\&. Other keys cause a value to be set in
827
\fIparam\fP as before\&. On a succesful return only one of \fIparam\fP or
828
\fIkpparm\fP contains a non\-empty string; the other is set to an empty
831
\fBtimeout\fP specifies a timeout value for input from \fItargetwin\fP\&.
832
If \fIintval\fP is negative, `\fBzcurses input\fP\&' waits indefinitely for
833
a character to be typed; this is the default\&. If \fIintval\fP is zero,
834
`\fBzcurses input\fP\&' returns immediately; if there is typeahead it is
835
returned, else no input is done and status 1 is returned\&. If \fIintval\fP
836
is positive, `\fBzcurses input\fP\&' waits \fIintval\fP milliseconds for
837
input and if there is none at the end of that period returns status 1\&.
847
Readonly integer\&. The maximum number of colors the terminal
848
supports\&. This value is initialised by the curses library and is not
849
available until the first time \fBzcurses init\fP is run\&.
851
\fBZCURSES_COLOR_PAIRS\fP
852
Readonly integer\&. The maximum number of color pairs
853
\fIfg_col\fP\fB/\fP\fIbg_col\fP that may be defined in `\fBzcurses attr\fP\&'
854
commands; note this limit applies to all color pairs that have been
855
used whether or not they are currently active\&. This value is initialised
856
by the curses library and is not available until the first time \fBzcurses
860
Readonly array\&. The attributes supported by \fBzsh/curses\fP; available
861
as soon as the module is loaded\&.
864
Readonly array\&. The colors supported by \fBzsh/curses\fP; available
865
as soon as the module is loaded\&.
867
\fBzcurses_windows\fP
868
Readonly array\&. The current list of windows, i\&.e\&. all windows that
869
have been created with `\fBzcurses addwin\fP\&' and not removed with
870
`\fBzcurses delwin\fP\&'\&.
662
871
.SH "THE ZSH/DATETIME MODULE"
663
872
.\" Yodl file: Zsh/mod_datetime.yo