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 NULL pointer for actions. that's the whole vibe.

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:

  • 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 is set to vNORMAL.
  • ESCAPE β€” the function returns the unknownUnsigned value (check the cdk_objs.h header file). the widget data exitType is set to vESCAPE_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, 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). and we mean weird. undefined, unhinged, not cute πŸ’€
  • 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, 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 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 data exitType to vNORMAL. 🫢
  • Tab β€” exits the widget and returns the current value. this also sets the widget data exitType to vNORMAL. 😭
  • Escape β€” exits the widget and returns the unknownUnsigned value (see the cdk_objs.h header file). this also sets the widget data exitType to vESCAPE_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. πŸ’–βœ¨