cdk_<MODEL>slider(3)

πŸ“¦
version 5.0.20260119 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

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 the cdk_objs.h header file). the widget data exitType gets set to vESCAPE_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 values TOP, BOTTOM, LEFT, RIGHT, or CENTER when relative = 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, 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. 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 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 unknown<DTYPE> value (peep the cdk_objs.h header file). This also sets the widget data exitType to vESCAPE_HIT.
  • Ctrl-R β€” refreshes the screen
fr fr heads up: that Escape one is your little escape hatch, and it hands back the unknown<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 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 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