cdk_slider(3)
okay bestie, sit down, hydrate, because we're doing cdk_slider(3) today β it lives in the library calls section of the manual and it's literally the cutest little integer slider you've ever seen. π
β¨ NAME β¨
cdk_slider β the Cdk slider widget (and it's type int, no cap) ποΈ
π¦ SYNOPSIS π¦
so first you gotta link the library, periodt:
cc [ flag ... ] file ... -lcdk [ library ... ]
and obviously you gotta bring the header in:
#include <cdk.h>
now here's the whole entire roster of functions, okay, every single one, I'm not skipping anybody, that's not the vibe:
int activateCDKSlider (
CDKSLIDER *slider,
chtype *actions);
void destroyCDKSlider (
CDKSLIDER *slider);
void drawCDKSlider (
CDKSLIDER *slider,
boolean box);
void eraseCDKSlider (
CDKSLIDER *slider);
boolean getCDKSliderBox (
CDKSLIDER *slider);
int getCDKSliderHighValue (
CDKSLIDER *slider);
int getCDKSliderLowValue (
CDKSLIDER *slider);
int getCDKSliderValue (
CDKSLIDER *slider);
int injectCDKSlider (
CDKSLIDER *slider,
chtype input);
void moveCDKSlider (
CDKSLIDER *slider,
int xpos,
int ypos,
boolean relative,
boolean refresh);
CDKSLIDER *newCDKSlider (
CDKSCREEN *cdkscreen,
int xpos,
int ypos,
const char *title,
const char *label,
chtype fillerCharacter,
int fieldWidth,
int currentValue,
int lowValue,
int highValue,
int increment,
int fastIncrement,
boolean box,
boolean shadow);
void positionCDKSlider (
CDKSLIDER *slider);
void setCDKSlider (
CDKSLIDER *slider,
int lowValue,
int highValue,
int currentValue,
boolean box);
void setCDKSliderBackgroundAttrib (
CDKSLIDER *slider,
chtype attribute);
void setCDKSliderBackgroundColor (
CDKSLIDER *slider,
const char * color);
void setCDKSliderBox (
CDKSLIDER *slider,
boolean boxWidget);
void setCDKSliderBoxAttribute (
CDKSLIDER *slider,
chtype character);
void setCDKSliderHorizontalChar (
CDKSLIDER *slider,
chtype character);
void setCDKSliderLLChar (
CDKSLIDER *slider,
chtype character);
void setCDKSliderLRChar (
CDKSLIDER *slider,
chtype character);
void setCDKSliderLowHigh (
CDKSLIDER *slider,
int lowValue,
int highValue);
void setCDKSliderPostProcess (
CDKSLIDER *slider,
PROCESSFN callback,
void * data);
void setCDKSliderPreProcess (
CDKSLIDER *slider,
PROCESSFN callback,
void * data);
void setCDKSliderULChar (
CDKSLIDER *slider,
chtype character);
void setCDKSliderURChar (
CDKSLIDER *slider,
chtype character);
void setCDKSliderValue (
CDKSLIDER *slider,
int value);
void setCDKSliderVerticalChar (
CDKSLIDER *slider,
chtype character);
π DESCRIPTION π
okay so the Cdk slider widget is giving visual slider box with a label and a slider field β that's the whole look, that's the aesthetic, it ate and left no crumbs. π«Ά
and everything below? that's the full friend group of functions that either create the Cdk slider box widget or manipulate it once it exists. one big happy family, and yeah, you're gonna meet all of them. π
anyway that's the setup β more coming, don't go anywhere bestie π β¨
β¨ AVAILABLE FUNCTIONS β¨
okay bestie, this is the whole function lineup π every single one, no skips. it's giving slider widget excellence π
π activateCDKSlider
activates the slider widget and lets the user interact with the widget.
- The parameter
slideris a pointer to a non-NULLslider widget. - If the
actionsparameter is passed with a non-NULLvalue, 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 value from the low value to the high value. It will also set the widget data exitType to vNORMAL.
If the character entered into this widget was ESCAPE then the widget returns the unknownInt value (see the cdk_objs.h header file). The widget data exitType is set to vESCAPE_HIT.
π¦ destroyCDKSlider
removes the widget from the screen and frees memory the object used.
drawCDKSlider
draws the slider widget on the screen. If the box option is true, the widget is drawn with a box.
eraseCDKSlider
removes the widget from the screen. This does NOT destroy the widget.
getCDKSliderBox
returns true if the widget will be drawn with a box around it.
getCDKSliderHighValue
returns the high value of the slider widget.
getCDKSliderLowValue
returns the low value of the slider widget.
getCDKSliderValue
returns the current value of the widget.
injectCDKSlider
injects a single character into the widget.
- The parameter
slideris a pointer to a non-NULLslider 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:
RETURNorTABβ the function returns a value ranging from the slider's low value to the slider's high value. The widget dataexitTypeis set tovNORMAL.ESCAPEβ the function returns theunknownIntvalue (see thecdk_objs.hheader file). The widget dataexitTypeis set tovESCAPE_HIT.
Otherwise unless modified by preprocessing, postprocessing or key bindings, the function returns the unknownInt value (see the cdk_objs.h header file). The widget data exitType is set to vEARLY_EXIT.
moveCDKSlider
moves the given widget to the given position.
- 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.
newCDKSlider
function creates a slider 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 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 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.labelβ is the string to display in the label of the slider field.fillerCharacterβ is the character to be used to draw the slider bar in the field.fieldWidthβ controls the width of the widget. If you provide a value of zero the widget will be created with the full width of the screen. If you provide a negative value, the widget will be created the full width minus the value provided.currentValueβ is the value of the slider field when the widget is activated.lowValueandhighValueβ are the low and high values of the widget respectively.incrementβ is the regular increment valuefastIncrementβ is the accelerated increment value.boxβ istrueif the widget should be drawn with a box around it.shadowβ turns the shadow on or off around this widget.
If the widget could not be created then a NULL pointer is returned.
positionCDKSlider
allows the user to move the widget around the screen via the cursor/keypad keys. See cdk_position (3) for key bindings.
setCDKSlider
lets the programmer modify certain elements of an existing slider widget. The parameter names correspond to the same parameter names listed in the newCDKSlider function.
setCDKSliderBackgroundAttrib
sets the background attribute of the widget.
The parameter attribute is a curses attribute, e.g., A_BOLD.
setCDKSliderBackgroundColor
sets the background color of the widget.
The parameter color is in the format of the Cdk format strings.
See cdk_display (3).
setCDKSliderBox
sets whether the widget will be drawn with a box around it.
setCDKSliderBoxAttribute
function sets the attribute of the box.
setCDKSliderHorizontalChar
sets the horizontal drawing character for the box to the given character.
setCDKSliderLLChar
sets the lower left hand corner of the widget's box to the given character.
setCDKSliderLRChar
sets the lower right hand corner of the widget's box to the given character.
setCDKSliderLowHigh
sets the low and high values of the widget.
setCDKSliderPostProcess
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).
setCDKSliderPreProcess
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).
setCDKSliderULChar
sets the upper left hand corner of the widget's box to the given character.
setCDKSliderURChar
sets the upper right hand corner of the widget's box to the given character.
setCDKSliderValue
sets the current value of the widget.
setCDKSliderVerticalChar
sets the vertical drawing character for the box to the given character.
πΉ KEY BINDINGS β¨οΈβ¨
okay bestie so once the widget is activated there's a whole lil arsenal of default key bindings that help you type stuff in or mess with the info fast. here's the full rundown of every key and what it does, no gatekeeping π
Down Arrowβ decrements the field by the normal decrement value.Up Arrowβ increments the field by the normal increment value.uβ increments the field by the normal increment value.Prev Pageβ decrements the field by the accelerated decrement value.Uβ decrements the field by the accelerated decrement value.Ctrl-Bβ decrements the field by the accelerated decrement value.Next Pageβ increments the field by the accelerated increment value.Dβ increments the field by the accelerated increment value.Ctrl-Fβ increments the field by the accelerated increment value.Homeβ sets the value to the low value.gβ sets the value to the low value.Endβ sets the value to the high value.Gβ sets the value to the high value.$β sets the value to the high value.Returnβ exits the widget and returns the current value. this also sets the widget dataexitTypetovNORMAL. π«ΆTabβ exits the widget and returns the current value. this also sets the widget dataexitTypetovNORMAL. π«ΆEscapeβ exits the widget and returns theunknownIntvalue (peep thecdk_objs.hheader file for that one). this also sets the widget dataexitTypetovESCAPE_HIT. πͺπ¨Ctrl-Rβ refreshes the screen. π
now here's the lil plot twist: if the cursor is not pointing at the field's value, a different set of bindings kicks in. you can use the left/right arrows to move the cursor onto the field's value and then modify it by typing characters to replace the digits and the sign. iconic behaviour honestly π
Left Arrowβ decrements the scale by the normal value.Right Arrowβ increments the scale by the normal value.dβ decrements the scale by the normal value.Dβ increments the scale by the accelerated value.-β decrements the scale by the normal value.+β increments the scale by the normal value.0β sets the scale to the low value.
π SEE ALSO π
go read these next, bestie, they're the whole friend group fr fr:
and that's a wrap on cdk_slider(3)!! this lil masterpiece is dated 2025-10-13 and answers to the name cdk_slider(3) β go forth and slide those values, you absolute legend ππβ¨
π¦ where this page comes from
- 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 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