cdk_slider(3)
π cdk_slider β Library calls π
okay bestie, welcome to the cdk_slider page, it's the Cdk slider widget and yes it's type int, we're all about them integers here, no cap π
β¨ NAME β¨
cdk_slider β the Cdk slider widget (type int). literally that's it. a slider. for ints. iconic. π
πΈ SYNOPSIS πΈ
so first you gotta link the library, obviously:
cc [ flag ... ] file ... -lcdk [ library ... ]
and pull in the header, don't forget it bestie:
#include <cdk.h>
then here's the whole roster of functions, verbatim, no edits, slay π«Ά:
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 here's the vibe: the Cdk slider widget makes a visual slider box β you get a label and a slider field, all pretty and interactive β¨
and then all the functions below? they're the ones that create the slider box or manipulate it. that's the whole deal. that's the assignment. π
ngl this page is long so it's split into parts β more coming, don't go anywhere bestie π§
β¨ AVAILABLE FUNCTIONS β¨
Okay bestie, this is the whole lineup of functions you can call on a slider widget. Each one is a little tool in your Unix toolkit. Let's go function by function, no skips, no cap. π
β¨ activateCDKSlider β¨
This one activates the slider widget and lets the user actually interact with it. It's giving main character energy.
sliderβ a pointer to a non-NULL slider widget. Don't pass garbage, okay?actionsβ if you pass this with a non-NULL value, the characters in the array get injected into the widget. If you want the widget to be interactive, pass aNULLpointer foractions. That's the vibe.
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. It also sets the widget data exitType to vNORMAL. Slay.
If the character entered into this widget was ESCAPE, then the widget returns the unknownInt value (peep the cdk_objs.h header file). The widget data exitType is set to vESCAPE_HIT. Not the vibe, but okay.
β¨ destroyCDKSlider β¨
This one removes the widget from the screen and frees the memory the object used. It's the ultimate cleanup, periodt. π§Ή
β¨ drawCDKSlider β¨
Draws the slider widget on the screen. If the box option is true, the widget is drawn with a box. Aesthetic.
β¨ eraseCDKSlider β¨
Removes the widget from the screen. This does NOT destroy the widget. So don't get it twisted.
β¨ getCDKSliderBox β¨
Returns true if the widget will be drawn with a box around it. Simple as.
β¨ getCDKSliderHighValue β¨
Returns the high value of the slider widget. The ceiling, the limit, the top tier.
β¨ getCDKSliderLowValue β¨
Returns the low value of the slider widget. The floor, the basement, the lowkey.
β¨ getCDKSliderValue β¨
Returns the current value of the widget. What's the vibe right now? This tells you.
β¨ injectCDKSlider β¨
Injects a single character into the widget. Like a little text message straight to the slider.
sliderβ a pointer to a non-NULL slider widget.characterβ the character to inject into the widget.
The return value and the side-effect (setting the widget data exitType) depend on 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. Okay so it's giving early exit, noted.
β¨ moveCDKSlider β¨
Moves the given widget to the given position. It's giving relocation.
xposandyposβ 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.
relativeβ states 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). Fr fr, don't do it.
refreshβ the final parameter, a boolean value which states whether the widget will get refreshed after the move. Do you want a glow-up or not?
β¨ newCDKSlider β¨
This function creates a slider widget and returns a pointer to it. Iconic. 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. Multi-line title? She's flexible.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 value.fastIncrementβ is the accelerated increment value.boxβ is true if 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. Not the slay we wanted.
β¨ positionCDKSlider β¨
Allows the user to move the widget around the screen via the cursor/keypad keys. See cdk_position (3) for key bindings. Go ahead, drag her around, she doesn't mind.
β¨ 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. So you already know the drill.
β¨ setCDKSliderBackgroundAttrib β¨
Sets the background attribute of the widget.
The parameter attribute is a curses attribute, e.g., A_BOLD. Bold background? We love a bold choice.
β¨ setCDKSliderBackgroundColor β¨
Sets the background color of the widget.
The parameter color is in the format of the Cdk format strings.
See cdk_display (3). Color her world. π
β¨ setCDKSliderBox β¨
Sets whether the widget will be drawn with a box around it. Box or no box, that is the question.
β¨ setCDKSliderBoxAttribute β¨
This function sets the attribute of the box. The box's whole personality.
β¨ setCDKSliderHorizontalChar β¨
Sets the horizontal drawing character for the box to the given character. Customize the horizontal lines, bestie.
β¨ setCDKSliderLLChar β¨
Sets the lower left hand corner of the widget's box to the given character. Corner customization, we love to see it.
β¨ setCDKSliderLRChar β¨
Sets the lower right hand corner of the widget's box to the given character. Another corner, another opportunity.
β¨ setCDKSliderLowHigh β¨
Sets the low and high values of the widget. Define her range, her limits, her whole spectrum.
β¨ setCDKSliderPostProcess β¨
Allows the user to have the widget call a function after the key has been applied to the widget. It's giving aftercare, but for keys.
functionβ the callback function.dataβ points 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. Pre-game, but make it code.
functionβ the callback function.dataβ points 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. Upper left corner, represent.
β¨ setCDKSliderURChar β¨
Sets the upper right hand corner of the widget's box to the given character. Upper right corner, also represent.
β¨ setCDKSliderValue β¨
Sets the current value of the widget. Change her mind, change her value.
β¨ setCDKSliderVerticalChar β¨
Sets the vertical drawing character for the box to the given character. Vertical lines, but make it custom. π
β¨οΈ KEY BINDINGS β¨οΈ
Okay bestie, so once the widget is activated (main character moment, we love to see it), there's a whole lil squad of default key bindings ready to help your user slam info in fast or fiddle with it. Here's the full rundown of keys and what they do for this widget π
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 valuePrev Pageβ decrements the field by the accelerated decrement value πβοΈUβ 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 value πgβ 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 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, if the cursor is not pointing at the field's value, a whole different set of key bindings kicks in. You may use the left/right arrows to move the cursor onto the field's value and modify it by typing characters to replace the digits and sign β¨
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 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
lowkey obsessed with how D does two totally different things depending on where your cursor is. it's giving versatility, fr fr π
π SEE ALSO π
and that's a wrap on cdk_slider(3) bestie!! ππ¦ this whole thing is from the cdk fam, dated 2025-01-14 β go forth and slide those sliders, you absolute icon πβ¨
π¦ where this page comes from
- debian trixie: libcdk5-dev 5.0.20250116-1 Β· BSD-4-Clause
- ubuntu questing: libcdk5-dev 5.0.20250116-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms