cdk_mentry(3)

πŸ“¦
version 5.0.20260119 Β· 4 versions
, in debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ 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 mentry is a pointer to a non-NULL mentry 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 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 mentry is a pointer to a non-NULL mentry.
  • 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:

  • RETURN or TAB β€” the function returns a char * representing the information typed into the widget. the widget data exitType is set to vNORMAL.
  • ESCAPE β€” the function returns a NULL pointer. the widget data exitType is set to vESCAPE_HIT.
  • Otherwise β€” unless modified by preprocessing, postprocessing or key bindings, the function returns a NULL pointer.
  • the widget data exitType is set to vEARLY_EXIT.

πŸ’œ moveCDKMentry

moves the given widget to the given position. scoot scoot. πŸ›Ό

  • 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.

πŸ’œ 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 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 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.

  • fieldRows and fieldWidth β€” 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. see cdk_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 the newCDKMentry function. tweak it.
  • setCDKMentryBackgroundAttrib β€” sets the background attribute of the widget. the parameter attribute is a curses attribute, e.g., A_BOLD. bold background energy.
  • setCDKMentryBackgroundColor β€” sets the background color of the widget. the parameter color is in the format of the Cdk format strings. see cdk_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 parameter callbackFunction is of type MENTRYCB. the default function is CDKMentryCallBack. 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 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). post-process vibes.
  • 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 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). pre-process vibes.
  • 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 data exitType in the widget pointer 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 in the widget pointer 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. πŸ”„

🌸 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. πŸ’…βœ¨