cdk_<MODEL>slider(3)
okay so you pulled up the manual for cdk_<MODEL>slider(3) β it's from the Library calls section, and bestie, it's giving slider widget energy. let's go π
β¨ NAME β¨
cdk_<MODEL>slider β it's the Cdk slider widget, and its type is <CTYPE>. no cap.
π¦ SYNOPSIS π¦
compile with -lcdk and include <cdk.h>, then use these functions. here's the whole lineup, exactly as the header gods wrote it:
cc [ flag ... ] file ... -lcdk [ library ... ]
#include <cdk.h>
int activateCDK<MIXED> (
CDK<UPPER> *slider,
chtype *actions);
void destroyCDK<MIXED> (
CDK<UPPER> *slider);
void drawCDK<MIXED> (
CDK<UPPER> *slider,
boolean box);
void eraseCDK<MIXED> (
CDK<UPPER> *slider);
boolean getCDK<MIXED>Box (
CDK<UPPER> *slider);
#if <FLOAT>
int getCDK<MIXED>Digits (
CDK<UPPER> *scale);
#endif <FLOAT>
<CTYPE> getCDK<MIXED>HighValue (
CDK<UPPER> *slider);
<CTYPE> getCDK<MIXED>LowValue (
CDK<UPPER> *slider);
<CTYPE> getCDK<MIXED>Value (
CDK<UPPER> *slider);
<CTYPE> injectCDK<MIXED> (
CDK<UPPER> *slider,
chtype input);
void moveCDK<MIXED> (
CDK<UPPER> *slider,
int xpos,
int ypos,
boolean relative,
boolean refresh);
CDK<UPPER> *newCDK<MIXED> (
CDKSCREEN *cdkscreen,
int xpos,
int ypos,
const char *title,
const char *label,
chtype fillerCharacter,
int fieldWidth,
int currentValue,
<CTYPE> lowValue,
<CTYPE> highValue,
<CTYPE> increment,
<CTYPE> fastIncrement,
#if <FLOAT>
int digits,
#endif <FLOAT>
boolean box,
boolean shadow);
void positionCDK<MIXED> (
CDK<UPPER> *slider);
void setCDK<MIXED> (
CDK<UPPER> *slider,
<CTYPE> lowValue,
<CTYPE> highValue,
<CTYPE> currentValue,
boolean box);
void setCDK<MIXED>BackgroundAttrib (
CDK<UPPER> *slider,
chtype attribute);
void setCDK<MIXED>BackgroundColor (
CDK<UPPER> *slider,
const char * color);
void setCDK<MIXED>Box (
CDK<UPPER> *slider,
boolean boxWidget);
void setCDK<MIXED>BoxAttribute (
CDK<UPPER> *slider,
chtype character);
#if <FLOAT>
void setCDK<MIXED>Digits (
CDK<UPPER> *scale,
int digits);
#endif <FLOAT>
void setCDK<MIXED>HorizontalChar (
CDK<UPPER> *slider,
chtype character);
void setCDK<MIXED>LLChar (
CDK<UPPER> *slider,
chtype character);
void setCDK<MIXED>LRChar (
CDK<UPPER> *slider,
chtype character);
void setCDK<MIXED>LowHigh (
CDK<UPPER> *slider,
<CTYPE> lowValue,
<CTYPE> highValue);
void setCDK<MIXED>PostProcess (
CDK<UPPER> *slider,
PROCESSFN callback,
void * data);
void setCDK<MIXED>PreProcess (
CDK<UPPER> *slider,
PROCESSFN callback,
void * data);
void setCDK<MIXED>ULChar (
CDK<UPPER> *slider,
chtype character);
void setCDK<MIXED>URChar (
CDK<UPPER> *slider,
chtype character);
void setCDK<MIXED>Value (
CDK<UPPER> *slider,
<CTYPE> value);
void setCDK<MIXED>VerticalChar (
CDK<UPPER> *slider,
chtype character);
π DESCRIPTION π
so basically the Cdk slider widget creates a visual slider box with a label and a slider field. the functions below? they create or manipulate that Cdk slider box widget. periodt.
β¨ AVAILABLE FUNCTIONS β¨
okay bestie, buckle UP, this is the whole roster of functions you get with this widget, and yes we're going through every single one, no skipping π
π¦ activateCDK<MIXED>
activates the slider widget and lets your user actually interact with it. main character moment fr.
- the parameter slider is a pointer to a non-NULL slider widget. don't be passing me a NULL, I will not be okay π
- if the actions parameter gets passed with a non-NULL value, then the characters sitting in that array get injected into the widget.
to activate the widget interactively, you pass in a NULL pointer for actions. that's the move.
so here's the tea on what comes back: if the character entered into this widget is RETURN or TAB, then this function returns a value from the low value to the high value. and it also sets the widget data exitType to vNORMAL β¨
but if the character entered into this widget was ESCAPE, then the widget returns the unknown<DTYPE> value (peep the cdk_objs.h header file for that one). and the widget data exitType gets set to vESCAPE_HIT π
π§ destroyCDK<MIXED>
removes the widget from the screen and frees the memory the object used. it's giving cleanup era. goodbye, you were iconic π«Ά
πΈ drawCDK<MIXED>
draws the slider widget on the screen. if the box option is true, the widget gets drawn with a box around it. cute little frame, we love to see it.
π eraseCDK<MIXED>
removes the widget from the screen. but bestie listen β this does NOT destroy the widget. it just leaves the room, it's still alive, okay?? huge difference, do not confuse them π
β getCDK<MIXED>Box
returns true if the widget will be drawn with a box around it.
#if <FLOAT>
π getCDK<MIXED>Digits
returns the number of digits shown after the decimal point for the box value.
#endif <FLOAT>
π getCDK<MIXED>HighValue
returns the high value of the slider widget. the ceiling, the limit, the top of the mountain.
π getCDK<MIXED>LowValue
returns the low value of the slider widget. the floor, the basement, the starting vibe.
β¨ getCDK<MIXED>Value
returns the current value of the widget. like, right now, in this exact moment. the now-value.
π injectCDK<MIXED>
injects a single character into the widget. just one. single. character. it's giving minimalism.
- the parameter slider is a pointer to a non-NULL slider widget.
- the parameter character is the character to inject into the widget.
the return value and the side-effect (aka setting the widget data exitType) depend on which character you injected:
- RETURN or TAB β the function returns a value ranging from the slider's low value to the slider's high value. the widget data exitType gets set to
vNORMAL. - ESCAPE β the function returns the
unknown<DTYPE>value (check thecdk_objs.hheader file). the widget data exitType gets set tovESCAPE_HIT.
otherwise, unless it's been modified by preprocessing, postprocessing or key bindings, the function returns the unknown<DTYPE> value (again, cdk_objs.h header file, you know the drill). and the widget data exitType gets set to vEARLY_EXIT.
π¦ moveCDK<MIXED>
moves the given widget to the given position. relocating, rebranding, fresh start β¨
- 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. but 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. and not the fun kind of weird π
- the final parameter refresh is a boolean value which states whether the widget will get refreshed after the move. yes or no, glow-up or stay as you were.
πΈ newCDK<MIXED>
this function creates a slider widget and returns a pointer to it. brand new, factory fresh, main character energy π
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, andCENTER. - 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, 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. multi-line title? slay.
- 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.
- lowValue and highValue β are the low and high values of the widget respectively. they're a package deal, besties.
- increment β is the regular increment value.
- fastIncrement β is the accelerated increment value. zoom zoom.
- box β is true if the widget should be drawn with a box around it.
- shadow β turns the shadow on or off around this widget. spooky-season optional.
if the widget could not be created then a NULL pointer is returned. no widget, just vibes and disappointment π
π positionCDK<MIXED>
allows the user to move the widget around the screen via the cursor/keypad keys. see cdk_position (3) for key bindings.
π setCDK<MIXED>
lets the programmer modify certain elements of an existing slider widget. the parameter names correspond to the same parameter names listed in the newCDK<MIXED> function. so yeah, everything you set up at birth, you can tweak later. glow-up unlocked.
π setCDK<MIXED>BackgroundAttrib
sets the background attribute of the widget.
the parameter attribute is a curses attribute, e.g., A_BOLD.
β setCDK<MIXED>BackgroundColor
sets the background color of the widget.
the parameter color is in the format of the Cdk format strings.
see cdk_display (3).
π setCDK<MIXED>Box
sets whether the widget will be drawn with a box around it. box on, box off, box optional, box iconic.
β¨ setCDK<MIXED>BoxAttribute
function sets the attribute of the box.
#if <FLOAT>
π§ setCDK<MIXED>Digits
sets the number of digits shown after the decimal point for the box value.
#endif <FLOAT>
π¦ setCDK<MIXED>HorizontalChar
sets the horizontal drawing character for the box to the given character.
π setCDK<MIXED>LLChar
sets the lower left hand corner of the widget's box to the given character. corner glow-up, lower-left edition.
πΈ setCDK<MIXED>LRChar
sets the lower right hand corner of the widget's box to the given character. lower-right, we see you.
π setCDK<MIXED>LowHigh
sets the low and high values of the widget. yes both, at the same time, together, as a duo π
π setCDK<MIXED>PostProcess
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).
π setCDK<MIXED>PreProcess
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).
β setCDK<MIXED>ULChar
sets the upper left hand corner of the widget's box to the given character.
π setCDK<MIXED>URChar
sets the upper right hand corner of the widget's box to the given character.
β¨ setCDK<MIXED>Value
sets the current value of the widget. you're in charge now.
π§ setCDK<MIXED>VerticalChar
sets the vertical drawing character for the box to the given character.
and bestie, we are not done yet, there is still more coming, do not close the tab π
π KEY BINDINGS π
Okay bestie, so once the widget is activated, there's a whole set of default key bindings just sitting there waiting to help you enter or manipulate the info fast. Here's the whole roster for this widget, no skips, no cuts π
Down Arrowβ decrements the field by the normal decrement valueUp Arrowβ increments the field by the normal increment valueuβ increments the field by the normal increment valuePrev Pageβ decrements the field by the accelerated decrement valueUβ decrements the field by the accelerated decrement valueCtrl-Bβ decrements the field by the accelerated decrement valueNext Pageβ increments the field by the accelerated increment valueDβ increments the field by the accelerated increment valueCtrl-Fβ increments the field by the accelerated increment valueHomeβ sets the value to the low valuegβ sets the value to the low valueEndβ sets the value to the high valueGβ sets the value to the high value$β sets the value to the high valueReturnβ 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 theunknown<DTYPE>value (peep thecdk_objs.hheader file). This also sets the widget dataexitTypetovESCAPE_HIT.Ctrl-Rβ refreshes the screen
fr fr heads up: thatEscapeone is your little escape hatch, and it hands back theunknown<DTYPE>value β not your current value. Don't get it twisted π
Now, plot twist β if the cursor is not pointing at the field's value, a whole 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, honestly β¨
Left Arrowβ decrements the scale by the normal valueRight Arrowβ increments the scale by the normal value
dβ decrements the scale by the normal valueDβ increments the scale by the accelerated value-β decrements the scale by the normal value+β increments the scale by the normal value0β sets the scale to the low value
π SEE ALSO π
Go read these too, they're the friend group of this page, no cap:
and that's a wrap on the whole page, bestie π«Ά this was cdk_<MODEL>slider(3), dated 2025-10-13 β go forth and slide responsibly, you absolute main character ππ
π¦ where this page comes from
- 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