cdk_mentry(3)
β¨ NAME β¨
cdk_mentry β the Cdk multiple line entry widget π (yes bestie, that's the whole NAME section, she's short but she's iconic)
so like. you know how a normal entry field is one line and you're squished in there? this one is the multiple line version. the manual page is cdk_mentry(3), it lives in the library calls section, and I'm gonna walk you through literally every single function, flag, and parameter. no cap, nothing skipped. π«Ά
πΈ SYNOPSIS πΈ
okay so first things first, you link it like this:
cc [ flag ... ] file ... -lcdk [ library ... ]
#include <cdk.h>
and here is the whole entire cast of characters, verbatim, don't @ me:
char *activateCDKMentry (
CDKMENTRY *mentry,
chtype *actions);
void cleanCDKMentry (
CDKMENTRY *mentry);
void destroyCDKMentry (
CDKMENTRY *mentry);
void drawCDKMentry (
CDKMENTRY *mentry,
boolean box);
void drawCDKMentryField (
CDKMENTRY *mentry);
void eraseCDKMentry (
CDKMENTRY *mentry);
boolean getCDKMentryBox (
CDKMENTRY *mentry);
chtype getCDKMentryFillerChar (
CDKMENTRY *mentry);
chtype getCDKMentryHiddenChar (
CDKMENTRY *mentry);
int getCDKMentryMin (
CDKMENTRY *mentry);
char *getCDKMentryValue (
CDKMENTRY *mentry);
char *injectCDKMentry (
CDKMENTRY *mentry,
chtype input);
void moveCDKMentry (
CDKMENTRY *mentry,
int xpos,
int ypos,
boolean relative,
boolean refresh);
CDKMENTRY *newCDKMentry (
CDKSCREEN *cdkscreen,
int xpos,
int ypos,
const char *title,
const char *label,
chtype fieldAttribute,
chtype fillerCharacter,
EDisplayType displayType,
int fieldWidth,
int fieldRows,
int logicalRows,
int minimumLength,
boolean box,
boolean shadow);
void positionCDKMentry (
CDKMENTRY *mentry);
void setCDKMentry (
CDKMENTRY *mentry,
const char *value,
int minimumLength,
boolean box);
void setCDKMentryBackgroundAttrib (
CDKMENTRY *mentry,
chtype attribute);
void setCDKMentryBackgroundColor (
CDKMENTRY *mentry,
const char * color);
void setCDKMentryBox (
CDKMENTRY *mentry,
boolean boxWidget);
void setCDKMentryBoxAttribute (
CDKMENTRY *mentry,
chtype character);
void setCDKMentryCB (
CDKMENTRY *mentry,
MENTRYCB callBackFunction);
void setCDKMentryFillerChar (
CDKMENTRY *mentry,
chtype filler);
void setCDKMentryHiddenChar (
CDKMENTRY *mentry,
chtype character);
void setCDKMentryHorizontalChar (
CDKMENTRY *mentry,
chtype character);
void setCDKMentryLLChar (
CDKMENTRY *mentry,
chtype character);
void setCDKMentryLRChar (
CDKMENTRY *mentry,
chtype character);
void setCDKMentryMin (
CDKMENTRY *mentry,
int maximum);
void setCDKMentryPostProcess (
CDKMENTRY *mentry,
PROCESSFN callback,
void * data);
void setCDKMentryPreProcess (
CDKMENTRY *mentry,
PROCESSFN callback,
void * data);
void setCDKMentryULChar (
CDKMENTRY *mentry,
chtype character);
void setCDKMentryURChar (
CDKMENTRY *mentry,
chtype character);
void setCDKMentryValue (
CDKMENTRY *mentry,
const char *value);
void setCDKMentryVerticalChar (
CDKMENTRY *mentry,
chtype character);
π¦ DESCRIPTION π¦
so the Cdk mentry widget creates a multiple line entry box with a label and an entry field. that's the vibe. π
and the functions listed below are the ones that create it or mess with it β the Cdk mentry box widget. that's literally what the description says and I am nothing if not a faithful narrator. π
π AVAILABLE FUNCTIONS π
π activateCDKMentry
activates the mentry widget and lets the user actually interact with it. main character moment, truly. β¨
- the parameter
mentryis a pointer to a non-NULL mentry 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 aNULLpointer foractions.
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 a NULL pointer and the widget data exitType is set to vESCAPE_HIT.
π cleanCDKMentry
clears the information from the field. bye bye text π
π destroyCDKMentry
removes the widget from the screen and frees the memory the object used. it's over over. π
π drawCDKMentry
draws the widget on the screen. if the box parameter is true, the widget is drawn with a box. π
π drawCDKMentryField
redraws the multiple line entry field. just the field. a lil refresh. π§
π eraseCDKMentry
removes the widget from the screen. this does NOT destroy the widget. she's offstage, not gone, bestie. π
π getCDKMentryBox
returns true if the widget will be drawn with a box around it.
π getCDKMentryFillerChar
returns the character being used to draw unused space in the widget.
π getCDKMentryHiddenChar
returns the character being used to draw hidden characters in the widget β and note, this one is (obsolete). π«
π getCDKMentryMin
returns the minimum length of a string the widget will allow.
π getCDKMentryValue
returns the current value of the widget. the receipts. π§Ύ
π injectCDKMentry
injects a single character into the widget.
- the parameter
mentryis a pointer to a non-NULL mentry. - 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:
RETURNorTABβ the function returns achar *representing the information typed into the widget. the widget dataexitTypeis set tovNORMAL.ESCAPEβ the function returns aNULLpointer. the widget dataexitTypeis set tovESCAPE_HIT.- Otherwise β unless modified by preprocessing, postprocessing or key bindings, the function returns a
NULLpointer.
- the widget data
exitTypeis set tovEARLY_EXIT.
π moveCDKMentry
moves the given widget to the given position. scoot scoot. πΌ
- the parameters
xposandyposare 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
relativestates whether thexpos/ypospair 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 valuesTOP,BOTTOM,LEFT,RIGHT, orCENTERwhenrelative = TRUE. (weird things may happen).
- the final parameter
refreshis a boolean value which states whether the widget will get refreshed after the move.
π newCDKMentry
creates a mentry widget and returns a pointer to it. here come the parameters, get comfy π
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 valuesLEFT,RIGHT, andCENTER.yposβ controls the placement of the object along the vertical axis. it may be an integer or one of the pre-defined valuesTOP,BOTTOM, andCENTER.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 mentry field.fieldAttributeβ is the attribute of the characters to be displayed when they are typed in.fillerβ is the character which is to display in an empty space in the mentry field.displayTypeβ tells how the mentry field will behave when a character is entered into the field. the following table outlines valid values for this field and what they mean:
okay so the Display_Type menu is lowkey a whole vibe check for your input field. here's every single one, no skips:
vCHARβ only accepts alphabetic characters. simple, clean, iconic. no cap.vLCHARβ only accepts alphabetic characters, and maps the accepted character to lower case. lowercase era, fr fr.vUCHARβ only accepts alphabetic characters, and maps the accepted character to upper case. UPPERCASE ENERGY, main character vibes.vHCHARβ only accepts alphabetic characters, and displays a.when a character has been accepted. it's giving secretive but cute.vUHCHARβ only accepts alphabetic characters, displays a., and maps the accepted character to upper case. dot dot dot + CAPS, obsessed.vLHCHARβ only accepts alphabetic characters, displays a., and maps the accepted character to lower case. dot dot dot + lowercase, lowkey perfect.vINTβ only accepts numeric characters. numbers only, bestie.vHINTβ only accepts numeric characters, and displays a.when a character has been accepted. secret numbers, iykyk.vMIXEDβ accepts any character types. anything goes! highkey iconic.vLMIXEDβ accepts any character types, and maps the accepted character to lower case when an alphabetic character has been accepted. mixed + lowercase, slay.vUMIXEDβ accepts any character types, and maps the accepted character to upper case when an alphabetic character has been accepted. mixed + UPPERCASE, periodt.vHMIXEDβ accepts any character types, and displays a.when a character has been accepted. mixed + hidden, not me loving this.vLHMIXEDβ accepts any character types, displays a., and maps the accepted character to lower case when an alphabetic character has been accepted. mixed + hidden + lowercase, literally perfect.vUHMIXEDβ accepts any character types, displays a., and maps the accepted character to upper case when an alphabetic character has been accepted. mixed + hidden + UPPERCASE, ate.vVIEWONLYβ uneditable field. look but don't touch, periodt.
fieldRowsandfieldWidthβ these control the height and width of the field of the widget. if you give a value of zero for either one, the field in the widget will be made as large as it can be, both in width and in height. if you give a negative value, the field will be created the full height or width minus the value you provided. math but make it fashion.logicalRowsβ is the number of rows for the mentry field. row count, got it.minimumLengthβ is the number of characters which must be entered before the user can exit the mentry field. you gotta type at least this many.callBackFunctionβ allows the user to override the key processing element of the widget. take the wheel.boxβ is true if the widget should be drawn with a box around it. boxy look.shadowβ turns the shadow on or off around this widget. spooky shadow vibes.
if the widget could not be created then a NULL pointer is returned. oof, no widget for you.
positionCDKMentryβ allows the user to move the widget around the screen via the cursor/keypad keys. seecdk_position (3)for key bindings. move it move it.setCDKMentryβ lets the programmer modify certain elements of an existing entry widget. the parameter names correspond to the same parameter names listed in thenewCDKMentryfunction. tweak it.setCDKMentryBackgroundAttribβ sets the background attribute of the widget. the parameterattributeis a curses attribute, e.g.,A_BOLD. bold background energy.setCDKMentryBackgroundColorβ sets the background color of the widget. the parametercoloris in the format of the Cdk format strings. seecdk_display (3). color splash.setCDKMentryBoxβ sets whether the widget will be drawn with a box around it. box on or off.setCDKMentryBoxAttributeβ function sets the attribute of the box. box attribute.setCDKMentryCBβ function allows the programmer to set a different widget input handler. the parametercallbackFunctionis of typeMENTRYCB. the default function isCDKMentryCallBack. custom handler, slay.setCDKMentryFillerCharβ sets the character to use when drawing unused space in the field. filler character.setCDKMentryHiddenCharβ sets the character to use when a hidden character type is used (obsolete). obsolete but iconic.setCDKMentryHorizontalCharβ function sets the horizontal drawing character for the box to the given character. horizontal line char.setCDKMentryLLCharβ function sets the lower left hand corner of the widget's box to the given character. lower left corner.setCDKMentryLRCharβ function sets the lower right hand corner of the widget's box to the given character. lower right corner.setCDKMentryMinβ sets the minimum length of the string that the widget will allow. minimum length, periodt.setCDKMentryPostProcessβ 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 seecdk_process(3). post-process vibes.
- the parameter
setCDKMentryPreProcessβ 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 seecdk_process(3). pre-process vibes.
- the parameter
setCDKMentryULCharβ sets the upper left hand corner of the widget's box to the given character. upper left corner.setCDKMentryURCharβ sets the upper right hand corner of the widget's box to the given character. upper right corner.setCDKMentryValueβ sets the current value of the widget. set the value.setCDKMentryVerticalCharβ sets the vertical drawing character for the box to the given character. vertical line char.
β¨ 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. (we're giving it to you as a list because tables are not the vibe here, but all the tea is the same):
- 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. β‘οΈ
- Up Arrow β moves the cursor one row down. yes, it says down. we don't make the rules. π€¨
- Down Arrow β moves the cursor one row up. and yes, it says up. iconic. π€¨
- 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 dataexitTypein the widget pointer tovNORMAL. β - Tab β exits the widget and returns a
char *representing the information which was typed into the field. it also sets the widget dataexitTypein the widget pointer tovNORMAL. β - Escape β exits the widget and returns a
NULLpointer. it also sets the widget dataexitTypetovESCAPE_HIT. πͺ - Ctrl-L β refreshes the screen. π
πΈ SEE ALSO πΈ
you gotta check out these other pages, bestie:
cdk(3), cdk_binding(3), cdk_display(3), cdk_position(3), cdk_screen(3)
and that's the whole page, bestie! this was cdk_mentry(3), dated 2025-01-14. now go forth and make your entry fields iconic. π
β¨
π¦ where this page comes from
- debian trixie: libcdk5-dev 5.0.20250116-1 Β· BSD-4-Clause
- fedora 43: cdk 5.0.20251014-1.fc43 Β· X11-distribute-modifications-variant
- fedora 43: cdk 5.0.20251014-1.fc43 Β· X11-distribute-modifications-variant
- fedora 44: cdk 5.0.20251014-3.fc44 Β· X11-distribute-modifications-variant
- fedora 44: cdk 5.0.20251014-3.fc44 Β· X11-distribute-modifications-variant
- nixos 26.05: cdk 5.0-20260119
- nixpkgs unstable: cdk 5.0-20260119
- ubuntu questing: libcdk5-dev 5.0.20250116-1
- ubuntu resolute: libcdk5-dev 5.0.20251014-1 Β· BSD-4-Clause
- ubuntu stonking: libcdk5-dev 5.0.20260119-1 Β· BSD-4-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms