cdk_uslider(3)
β¨ cdk_uslider(3) β¨
okay bestie, welcome to the cdk_uslider manual page β it's giving Cdk slider widget energy, and specifically the unsigned type, no cap. if you came here looking for signed sliders, this is not that page, but you're still in the right place for the unsigned one π
π NAME π
cdk_uslider β Cdk slider widget (type unsigned)
β¨ SYNOPSIS β¨
compile it like this, bestie:
cc [ flag ... ] file ... -lcdk [ library ... ]
#include <cdk.h>
int activateCDKUSlider (
CDKUSLIDER *slider,
chtype *actions);
void destroyCDKUSlider (
CDKUSLIDER *slider);
void drawCDKUSlider (
CDKUSLIDER *slider,
boolean box);
void eraseCDKUSlider (
CDKUSLIDER *slider);
boolean getCDKUSliderBox (
CDKUSLIDER *slider);
unsigned getCDKUSliderHighValue (
CDKUSLIDER *slider);
unsigned getCDKUSliderLowValue (
CDKUSLIDER *slider);
unsigned getCDKUSliderValue (
CDKUSLIDER *slider);
unsigned injectCDKUSlider (
CDKUSLIDER *slider,
chtype input);
void moveCDKUSlider (
CDKUSLIDER *slider,
int xpos,
int ypos,
boolean relative,
boolean refresh);
CDKUSLIDER *newCDKUSlider (
CDKSCREEN *cdkscreen,
int xpos,
int ypos,
const char *title,
const char *label,
chtype fillerCharacter,
int fieldWidth,
int currentValue,
unsigned lowValue,
unsigned highValue,
unsigned increment,
unsigned fastIncrement,
boolean box,
boolean shadow);
void positionCDKUSlider (
CDKUSLIDER *slider);
void setCDKUSlider (
CDKUSLIDER *slider,
unsigned lowValue,
unsigned highValue,
unsigned currentValue,
boolean box);
void setCDKUSliderBackgroundAttrib (
CDKUSLIDER *slider,
chtype attribute);
void setCDKUSliderBackgroundColor (
CDKUSLIDER *slider,
const char * color);
void setCDKUSliderBox (
CDKUSLIDER *slider,
boolean boxWidget);
void setCDKUSliderBoxAttribute (
CDKUSLIDER *slider,
chtype character);
void setCDKUSliderHorizontalChar (
CDKUSLIDER *slider,
chtype character);
void setCDKUSliderLLChar (
CDKUSLIDER *slider,
chtype character);
void setCDKUSliderLRChar (
CDKUSLIDER *slider,
chtype character);
void setCDKUSliderLowHigh (
CDKUSLIDER *slider,
unsigned lowValue,
unsigned highValue);
void setCDKUSliderPostProcess (
CDKUSLIDER *slider,
PROCESSFN callback,
void * data);
void setCDKUSliderPreProcess (
CDKUSLIDER *slider,
PROCESSFN callback,
void * data);
void setCDKUSliderULChar (
CDKUSLIDER *slider,
chtype character);
void setCDKUSliderURChar (
CDKUSLIDER *slider,
chtype character);
void setCDKUSliderValue (
CDKUSLIDER *slider,
unsigned value);
void setCDKUSliderVerticalChar (
CDKUSLIDER *slider,
chtype character);
π DESCRIPTION π
the Cdk slider widget is literally iconic β it creates a visual slider box with a label and a slider field. that's the whole vibe: a box, a label, a field you can slide. slay.
and then, bestie, the following functions are the ones that create or manipulate the Cdk slider box widget. every single one of them. no skipping, no summarizing, periodt. π«Ά
next parts are coming, so stay perched π
β¨ AVAILABLE FUNCTIONS β¨
okay bestie, here's the whole roster of things you can call on a USlider π she's got range, she's got options, and every single one of them is listed below, no skips, no shortcuts.
activateCDKUSlider
turns the slider ON and lets your user actually mess with it ποΈ main character activation energy.
- the parameter slider is a pointer to a non-NULL slider widget. she needs a real widget, no NULLs bestie.
- if the actions parameter is passed with a non-NULL value, the characters in the array will be injected into the widget.
- wanna activate the widget interactively? pass in a
NULLpointer for actions. that's the whole vibe.
- wanna activate the widget interactively? pass in a
so, if the character entered into this widget is RETURN or TAB, this function will return a value from the low value to the high value. it will ALSO set the widget data exitType to vNORMAL. immaculate behavior honestly.
if the character entered into this widget was ESCAPE then the widget returns the unknownUnsigned value (go look at the cdk_objs.h header file, it's right there π«Ά). the widget data exitType is set to vESCAPE_HIT. dramatic exit, we love her.
destroyCDKUSlider
removes the widget from the screen AND frees the memory the object used. full cleanup, no leftovers, we're leaving this place better than we found it β¨
drawCDKUSlider
draws the slider widget on the screen. if the box option is true, the widget is drawn with a box. boxed and gorgeous π
eraseCDKUSlider
removes the widget from the screen. this does NOT destroy the widget. she's just not visible rn, she's still here, still thriving π¦
do not confuse erasing with destroying. erasing = hiding. destroying = gone forever. the distinction is everything.
getCDKUSliderBox
returns true if the widget will be drawn with a box around it. vibe check on the box situation π¦
getCDKUSliderHighValue
returns the high value of the slider widget.
getCDKUSliderLowValue
returns the low value of the slider widget.
getCDKUSliderValue
returns the current value of the widget.
injectCDKUSlider
injects a single character into the widget. one (1) character, hand-delivered, no cap π
- 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 (that's the setting of the widget data exitType) depend entirely on which character you inject:
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 theunknownUnsignedvalue (check thecdk_objs.hheader file). the widget dataexitTypeis set tovESCAPE_HIT.
otherwise β unless it's modified by preprocessing, postprocessing, or key bindings β the function returns the unknownUnsigned value (again, cdk_objs.h header file, she lives there). the widget data exitType is set to vEARLY_EXIT.
moveCDKUSlider
moves the given widget to the given position. relocating, but make it fashion π§
- 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, andCENTER. - the parameter ypos may be an integer or one of the pre-defined values
LEFT,RIGHT, andCENTER.
- the parameter xpos may be an integer or one of the pre-defined values
- the parameter relative states whether the xpos/ypos pair is a relative move or an absolute move.
- for example, if
xpos = 1andypos = 2andrelative = TRUE, then the widget would move one row down and two columns right. if the value of relative wasFALSE, then the widget would move to the position(1,2). - do not use the values
TOP,BOTTOM,LEFT,RIGHT, orCENTERwhenrelative = TRUE. (weird things may happen). and we mean weird. undefined, unhinged, not cute π
- for example, if
- the final parameter refresh is a boolean value which states whether the widget will get refreshed after the move.
newCDKUSlider
this function creates a slider widget and returns a pointer to it. brand new widget, freshly born, already 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 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.
- 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.
- 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. sad girl hours π but at least you know.
positionCDKUSlider
allows the user to move the widget around the screen via the cursor/keypad keys. see cdk_position (3) for key bindings. drag her around like a little window sticker, she doesn't mind π«
setCDKUSlider
lets the programmer modify certain elements of an existing slider widget. the parameter names correspond to the same parameter names listed in the newCDKUSlider function. same names, same energy, mid-life glow-up π
setCDKUSliderBackgroundAttrib
sets the background attribute of the widget.
the parameter attribute is a curses attribute, e.g., A_BOLD.
setCDKUSliderBackgroundColor
sets the background color of the widget.
the parameter color is in the format of the Cdk format strings.
see cdk_display (3).
setCDKUSliderBox
sets whether the widget will be drawn with a box around it. box on, box off, you decide π¦β¨
setCDKUSliderBoxAttribute
this function sets the attribute of the box.
setCDKUSliderHorizontalChar
sets the horizontal drawing character for the box to the given character.
setCDKUSliderLLChar
sets the lower left hand corner of the widget's box to the given character.
setCDKUSliderLRChar
sets the lower right hand corner of the widget's box to the given character.
setCDKUSliderLowHigh
sets the low and high values of the widget. the full range, both ends, we're adjusting the whole spectrum π
setCDKUSliderPostProcess
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-key clarity β¨
setCDKUSliderPreProcess
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). catching it on the way in π«Ά
setCDKUSliderULChar
sets the upper left hand corner of the widget's box to the given character.
setCDKUSliderURChar
sets the upper right hand corner of the widget's box to the given character.
setCDKUSliderValue
sets the current value of the widget.
setCDKUSliderVerticalChar
sets the vertical drawing character for the box to the given character.
β¨ KEY BINDINGS β¨
okay bestie, when the widget is activated there are default key bindings that help the user enter or manipulate the information quickly. no cap. here's the rundown of every key and its action 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 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 theunknownUnsignedvalue (see thecdk_objs.hheader file). this also sets the widget dataexitTypetovESCAPE_HIT. πCtrl-Rβ refreshes the screen. β¨
if the cursor is not pointing to the field's value, the following key bindings apply. 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. lowkey iconic:
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 π
and that's the whole vibe, bestie. this page is cdk_uslider(3), dated 2025-10-13. slay. πβ¨
π¦ 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