eraseCDKSwindow3
Cdk scrolling window widget
Part of cdk_swindow(3).
Usage
cc [flag ...]
file ...
-lcdk
[library ...]
Overview
The Cdk scrolling window (swindow) widget can be used to display messages. The following functions create or manipulate the Cdk swindow box widget.
Available functions
activateCDKSwindow-
function activates the swindow widget and lets the user interact with the widget.
- •
-
The parameter
swindowis a pointer to a non-NULL swindow widget.
- •
-
If the
actionsparameter is passed with a non-NULL value, the characters in the array will be injected into the widget.
-
To activate the widget interactively pass in a NULL pointer for
actions.
-
If the character entered into this widget is RETURN or TAB then this function will return 1. It will also set the widget data exitType to vNORMAL.
-
If the character entered into this widget was ESCAPE then the widget will return a value of -1 and the widget data exitType will be set to vESCAPE_HIT.
addCDKSwindow-
adds information to a scrolling window.
- •
-
The information is supplied by the
infoparameter. The information is immediately added to the scrolling window.
- •
-
The position of the new information is governed by the value of the parameter
insertPosition. This parameter may be two values: TOP or BOTTOM.
cleanCDKSwindow-
clears the information from the window.
destroyCDKSwindow-
removes the widget from the screen and frees memory the object used.
drawCDKSwindow-
draws the swindow widget on the screen.
-
If the
boxparameter is true, the widget is drawn with a box.
dumpCDKSwindow-
saves the contents of the scrolling window into the file specified by the
filenameparameter. It returns -1 on failure, and the number of lines saved if the dump was successful.
eraseCDKSwindow-
removes the widget from the screen. This does NOT destroy the widget.
execCDKSwindow-
allows the user to execute a shell command and have the output of the shell command direct itself to the scrolling window.
- •
-
The
commandparameter is the command to execute.
- •
-
The
insertPositionparameter tells where the output will be inserted within the scrolling window.
getCDKSwindowBox-
returns true if the widget will be drawn with a box around it.
getCDKSwindowContents-
returns the contents of the scrolling window.
-
The parameter
lineswill be set to the number of lines returned.
injectCDKSwindow-
injects a single character into the widget.
- •
-
The parameter
swindowis a pointer to a non-NULL swindow widget.
- •
-
The parameter
characteris the character to inject into the widget.
-
The return value and side-effect (setting the widget data exitType) depend upon the injected character:
- RETURN or TAB
-
the function returns 1. The widget data exitType is set to vNORMAL.
- ESCAPE
-
the function returns -1. The widget data exitType is set to vESCAPE_HIT.
- Otherwise
-
unless modified by preprocessing, postprocessing or key bindings, the function returns -1. The widget data exitType is set to vEARLY_EXIT.
jumpToLineCDKSwindow-
moves the scrolling window to the given line.
-
The parameter
linemay be an integer or one of the two predefined values TOP and BOTTOM.
loadCDKSwindowInformation-
allows the user to load the contents of a file into the scrolling window. This function is interactive, and will ask for a filename.
moveCDKSwindow-
moves the given widget to the given position.
- •
-
The parameters
xposandyposare the new position of the widget.
-
The parameter
xposmay be an integer or one of the pre-defined values TOP, BOTTOM, and CENTER.
-
The parameter
yposmay be an integer or one of the pre-defined values LEFT, RIGHT, and CENTER.
- •
-
The parameter
relativestates whether thexpos/ypospair is a relative move or an absolute move.
-
For example, if
xpos= 1 andypos= 2 andrelative= TRUE, then the widget would move one row down and two columns right. If the value ofrelativewas FALSE, then the widget would move to the position (1,2).
-
Do not use the values TOP, BOTTOM, LEFT, RIGHT, or CENTER when
relative= TRUE (weird things may happen).
- •
-
The final parameter
refreshis a boolean value which states whether the widget will get refreshed after the move.
newCDKSwindow-
creates a swindow widget and returns a pointer to it. Parameters:
screen-
is the screen you wish this widget to be placed in.
xpos-
controls the placement of the object along the horizontal axis. It may be an integer or one of the pre-defined values LEFT, RIGHT, and CENTER.
ypos-
controls the placement of the object along the vertical axis. It may be an integer or one of the pre-defined values TOP, BOTTOM, and CENTER.
heightand
width-
control the height and width of the widget. If you provide a value of zero for either of the height or the width, the widget will be created with the full width and height of the screen. If you provide a negative value, the widget will be created the full height or width minus the value provided.
title-
is the string to display at the top of the widget. The title can be more than one line; just provide a carriage return character at the line break.
saveLines-
is the number of lines to save before throwing information away.
box-
is true if the widget should be drawn with a box around it.
- The
shadow -
turns the shadow on or off around this widget.
-
If the widget could not be created then a NULL pointer is returned.
positionCDKSwindow-
allows the user to move the widget around the screen via the cursor/keypad keys. See cdk_position (3) for key bindings.
saveCDKSwindowInformation-
allows the user to save the contents of the scrolling window into a file. This function is interactive, and will ask for a filename.
setCDKSwindow-
lets the programmer modify certain elements of an existing swindow widget.
- •
-
The parameter
infois a char ** of the information to set in the scrolling window;linesis the number of lines being added.
- •
-
The other parameter names correspond to the same parameter names listed in the
newCDKSwindowfunction.
setCDKSwindowBackgroundAttrib-
sets the background attribute of the widget.
-
The parameter
attributeis a curses attribute, e.g., A_BOLD.
setCDKSwindowBackgroundColor-
sets the background color of the widget.
-
The parameter
coloris in the format of the Cdk format strings.
-
See cdk_display (3).
setCDKSwindowBox-
sets whether the widget will be drawn with a box around it.
setCDKSwindowBoxAttribute-
sets the attribute of the box.
setCDKSwindowContents-
lets the programmer modify certain elements of an existing swindow widget.
- •
-
The parameter
infois a char ** of the information to set in the scrolling window.
- •
-
linesis the number of lines being added.
setCDKSwindowHorizontalChar-
sets the horizontal drawing character for the box to the given character.
setCDKSwindowLLChar-
sets the lower left hand corner of the widget's box to the given character.
setCDKSwindowLRChar-
sets the lower right hand corner of the widget's box to the given character.
setCDKSwindowPostProcess-
allows the user to have the widget call a function after the key has been applied to the widget.
- •
-
The parameter
functionis the callback function.
- •
-
The parameter
datapoints to data passed to the callback function.
-
To learn more about post-processing see cdk_process(3).
setCDKSwindowPreProcess-
allows the user to have the widget call a function after a key is hit and before the key is applied to the widget.
- •
-
The parameter
functionis the callback function.
- •
-
The parameter
datapoints to data passed to the callback function.
-
To learn more about pre-processing see cdk_process(3).
setCDKSwindowULChar-
sets the upper left hand corner of the widget's box to the given character.
setCDKSwindowURChar-
sets the upper right hand corner of the widget's box to the given character.
setCDKSwindowVerticalChar-
sets the vertical drawing character for the box to the given character.
trimCDKSwindow-
removes information from a scrolling window.
-
The parameters
startandendstate where to start cutting from and where to stop.
-
The first element in the scrolling window starts at index 0.
Key bindings
When the widget is activated there are several default key bindings which will help the user enter or manipulate the information quickly. The following table outlines the keys and their actions for this widget.
| Key | Action |
| Left Arrow | Scrolls the window left one column. |
| Right Arrow | Scrolls the window right one column. |
| Up Arrow | Scrolls the window up one row. |
| Down Arrow | Scrolls the window down one row. |
| Prev Page | |
| Ctrl-B | |
| b | |
| B | Scroll the window backward one page. |
| Next Page | |
| Ctrl-F | |
| Space | |
| f | |
| F | Scroll the window forward one page. |
| Home | |
| | | Scroll the list to the left margin. |
| End | |
| $ | Scroll the list to the right margin. |
| 1 | |
| < | |
| g | Move to the top of the scrolling window. |
| > | |
| G | Move to the bottom of the scrolling window. |
| l | |
| L | Load a file into the scrolling window. |
| s | |
| S | Save the contents of the scrolling window into a file. |
| Return | Set the widget's exitType to vNORMAL, exit the widget and return 1. |
| Tab | Set the widget's exitType to vNORMAL, exit the widget and return 1. |
| Escape | Set the widget's exitType to vESCAPE_HIT, exit the widget and return -1. |
| Ctrl-L | Refreshes the screen. |
History
- Debian 13 (Trixie): the text shown here
- Debian 12 (Bookworm) to Debian 9 (Stretch)
- Debian 8 (Jessie) to Debian 7 (Wheezy)
- Debian 6.0 (Squeeze) to Debian 5.0 (Lenny)
- Debian 4.0 (Etch)
- Debian 3.1 (Sarge) to Debian 3.0 (Woody)