DOKK / manpages / debian 12 / libcdk5-dev / eraseCDKEntry.3.en
cdk_entry(3) Library Functions Manual cdk_entry(3)

cdk_entry - curses text-entry widget.

cc [ flag ... ] file ... -lcdk [ library ... ]

#include <cdk.h>

CDKENTRY *entry,
chtype *actions);
CDKENTRY *entry);
CDKENTRY *entry);
CDKENTRY *entry,
boolean box);
CDKENTRY *entry);
CDKENTRY *entry);
CDKENTRY *entry);
CDKENTRY *entry);
CDKENTRY *entry);
CDKENTRY *entry);
CDKENTRY *entry);
CDKENTRY *entry,
chtype input);
CDKENTRY *entry,
int xpos,
int ypos,
boolean relative,
boolean refresh);
CDKSCREEN *cdkscreen,
int xpos,
int ypos,
const char *title,
const char *label,
chtype fieldAttribute,
chtype fillerCharacter,
EDisplayType displayType,
int fieldWidth,
int minimumLength,
int maximumLength,
boolean box,
boolean shadow);
CDKENTRY *entry);
CDKENTRY *entry,
const char *value,
int minimumLength,
int maximumLength,
boolean box);
CDKENTRY *entry,
chtype attribute);
CDKENTRY *entry,
const char * color);
CDKENTRY *entry,
boolean box);
CDKENTRY *entry,
chtype character);
CDKENTRY *entry,
ENTRYCB callBackFunction);
CDKENTRY *entry,
chtype character);
CDKENTRY *entry,
chtype character);
CDKENTRY *entry,
chtype highlight,
boolean cursor);
CDKENTRY *entry,
chtype character);
CDKENTRY *entry,
chtype character);
CDKENTRY *entry,
chtype character);
CDKENTRY *entry,
int maximum);
CDKENTRY *entry,
int minimum);
CDKENTRY *entry,
PROCESSFN callback,
void * data);
CDKENTRY *entry,
PROCESSFN callback,
void * data);
CDKENTRY *entry,
chtype character);
CDKENTRY *entry,
chtype character);
CDKENTRY *entry,
const char *value);
CDKENTRY *entry,
chtype character);

The Cdk entry widget creates a text-entry box with a label and an entry field. The following functions create or manipulate the Cdk entry box widget.

activates the entry widget and lets the user interact with the widget.
  • The parameter entry is a pointer to a non-NULL entry widget.
  • If the actions parameter 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 a char * representing the information typed into the widget and the widget data exitType will be set to vNORMAL.
If the character entered was ESCAPE then the function will return NULL pointer and the widget data exitType is set to vESCAPE_HIT.
clears the information from the field.
removes the widget from the screen and frees memory the object used.
draws the entry widget on the screen.
If the box parameter is true, the widget is drawn with a box.
removes the widget from the screen. This does NOT destroy the widget.
returns true if the widget will be drawn with a box around it.
returns the character being used to draw unused space in the widget.
returns the character being used to draw the hidden character type.
returns the maximum length of a string the widget will allow.
returns the minimum length of a string the widget will allow.
returns the current value of the widget.
injects a single character into the widget.
  • The parameter entry is a pointer to a non-NULL entry widget.
  • The parameter character is the character to inject into the widget.
The return value and side-effect (setting the widget data exitType) depend upon the injected character:
the function returns a char * representing the information typed into the widget. The widget data exitType is set to vNORMAL.
the function returns a NULL pointer. The widget data exitType is set to vESCAPE_HIT.
unless modified by preprocessing, postprocessing or key bindings, the function returns a NULL pointer. The widget data exitType is set to vEARLY_EXIT.
moves the given widget to the given position.
The parameters xpos and ypos are the new position of the widget.
The parameter xpos may be an integer or one of the pre-defined values TOP, BOTTOM, and CENTER.
The parameter ypos may be an integer or one of the pre-defined values LEFT, RIGHT, and CENTER.
The parameter relative states whether the xpos/ypos pair is a relative move or an absolute move.
For example, if xpos = 1 and ypos = 2 and relative = TRUE, then the widget would move one row down and two columns right. If the value of relative was 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 refresh is a boolean value which states whether the widget will get refreshed after the move.
creates a pointer to an entry widget. Parameters:
  • The screen parameter 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.
  • title is the string which will be displayed at the top of the widget. The title can be more than one line; just provide a carriage return character at the line break.
  • label is the string which will be displayed in the label of the entry field.
  • fieldAttribute is the attribute of the characters which are typed in.
  • filler is the character which is to be displayed in an empty space in the entry field.
  • displayType tells how the entry field will behave when a character is entered into the field. See cdk_display (3) for valid values for this field.
  • fieldWidth denotes the width of the field:
  • If a value of zero is provided, the field will be made as wide as possible on the screen.
  • If a negative value is given, then the field width will be the maximum width minus the value provided.
  • minimumLength controls the number of characters which must be entered before the user can exit the entry field.
  • maximumLength sets the maximum number of characters that can be entered.
  • box is true if the widget should be drawn with a box around it.
  • shadow turns the shadow on around this widget.
If the widget could not be created then a NULL pointer is returned.
allows the user to move the widget around the screen via the cursor/keypad keys. The following key bindings can be used to move the widget around the screen. See cdk_position (3) for key bindings.
lets the programmer modify certain elements of an existing entry widget.
  • The value parameter sets the value of the contents of the entry field.
  • The other parameter names correspond to the same parameter names listed in the newCDKEntry function.
sets the background attribute of the widget.
The parameter attribute is a curses attribute, e.g., A_BOLD.
sets the background color of the widget.
The parameter color is in the format of the Cdk format strings. See cdk_display (3).
sets whether the widget will be drawn with a box around it.
function sets the attribute of the box.
allows the programmer to set a different widget input handler.
The parameter callbackFunction is of type ENTRYCB.
The default function is CDKEntryCallBack.
sets the character to use when drawing unused space in the field.
sets the character to use when using a hidden character type.
sets the attribute of the entry field.
sets the horizontal drawing character for the box to the given character.
sets the lower left hand corner of the widget's box to the given character.
sets the lower right hand corner of the widget's box to the given character.
sets the maximum length of the string that the widget will allow.
sets the minimum length of the string that the widget will allow.
allows the user to have the widget call a function after the key has been applied to the widget.
  • The parameter function is the callback function.
  • The parameter data points to data passed to the callback function.
To learn more about post-processing see cdk_process (3).
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 function is the callback function.
  • The parameter data points to data passed to the callback function.
To learn more about pre-processing see cdk_process (3).
sets the upper left hand corner of the widget's box to the given character.
sets the upper right hand corner of the widget's box to the given character.
sets the current value of the widget.
sets the vertical drawing character for the box to the given character.

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 Moves the cursor to the left.
CTRL-B Moves the cursor to the left.
Right Arrow Moves the cursor to the right.
CTRL-F Moves the cursor to the right.
Delete Deletes the character at the cursor.
Backspace Deletes the character before cursor, moves cursor left.
CTRL-V Pastes whatever is in the paste buffer, into the widget.
CTRL-X Cuts the contents from the widget and saves a copy in the paste buffer.
CTRL-Y Copies the contents of the widget into the paste buffer.
CTRL-U Erases the contents of the widget.
CTRL-A Moves the cursor to the beginning of the entry field.
CTRL-E Moves the cursor to the end of the entry field.
CTRL-T Transposes the character under the cursor with the character to the right.
Return Exits the widget and returns a char * representing the information which was typed into the field. It also sets the widget data exitType to vNORMAL.
Tab Exits the widget and returns a char * representing the information which was typed into the field. It also sets the widget data exitType to vNORMAL.
Escape Exits the widget and returns a NULL pointer. It also sets the widget data exitType to vESCAPE_HIT.
Ctrl-L Refreshes the screen.

cdk(3), cdk_binding(3), cdk_display(3), cdk_position(3), cdk_process(3), cdk_screen(3)