cdk_scale(3)

🌸 NAME 🌸

okay so bestie, welcome to the cdk_scale(3) manual page β€” it's the Cdk scale widget, and it's type int, no cap. πŸ’–

  • cdk_scale β€” Cdk scale widget (type int) πŸŽ€

✨ SYNOPSIS ✨

bestie, here's the compile line and every single function signature, exactly as they are, fr fr. don't rename anything, don't merge anything, just vibe with it. πŸ’…

       cc [ flag ... ] file ...  -lcdk [ library ... ]

       #include <cdk.h>

       int activateCDKScale (
                      CDKSCALE *scale,
                      chtype *actions);

       void destroyCDKScale (
                      CDKSCALE *scale);

       void drawCDKScale (
                      CDKSCALE *scale,
                      boolean box);

       void eraseCDKScale (
                      CDKSCALE *scale);

       boolean getCDKScaleBox (
                      CDKSCALE *scale);

       int getCDKScaleHighValue (
                      CDKSCALE *scale);

       int getCDKScaleLowValue (
                      CDKSCALE *scale);

       int getCDKScaleValue (
                      CDKSCALE *scale);

       int injectCDKScale (
                      CDKSCALE *scale,
                      chtype input);

       void moveCDKScale (
                      CDKSCALE *scale,
                      int xpos,
                      int ypos,
                      boolean relative,
                      boolean refresh);

       CDKSCALE *newCDKScale (
                      CDKSCREEN *cdkscreen,
                      int xpos,
                      int ypos,
                      const char *title,
                      const char *label,
                      chtype fieldAttribute,
                      int fieldWidth,
                      int currentValue,
                      int lowValue,
                      int highValue,
                      int increment,
                      int fastIncrement,
                      boolean box,
                      boolean shadow);

       void positionCDKScale (
                      CDKSCALE *scale);

       void setCDKScale (
                      CDKSCALE *scale,
                      int lowValue,
                      int highValue,
                      int currentValue,
                      boolean box);

       void setCDKScaleBackgroundAttrib (
                      CDKSCALE *scale,
                      chtype attribute);

       void setCDKScaleBackgroundColor (
                      CDKSCALE *scale,
                      const char * color);

       void setCDKScaleBox (
                      CDKSCALE *scale,
                      boolean box);

       void setCDKScaleBoxAttribute (
                      CDKSCALE *scale,
                      chtype character);

       void setCDKScaleHorizontalChar (
                      CDKSCALE *scale,
                      chtype character);

       void setCDKScaleLLChar (
                      CDKSCALE *scale,
                      chtype character);

       void setCDKScaleLRChar (
                      CDKSCALE *scale,
                      chtype character);

       void setCDKScaleLowHigh (
                      CDKSCALE *scale,
                      int low,
                      int high);

       void setCDKScalePostProcess (
                      CDKSCALE *scale,
                      PROCESSFN callback,
                      void * data);

       void setCDKScalePreProcess (
                      CDKSCALE *scale,
                      PROCESSFN callback,
                      void * data);

       void setCDKScaleULChar (
                      CDKSCALE *scale,
                      chtype character);

       void setCDKScaleURChar (
                      CDKSCALE *scale,
                      chtype character);

       void setCDKScaleValue (
                      CDKSCALE *scale,
                      int value);

       void setCDKScaleVerticalChar (
                      CDKSCALE *scale,
                      chtype character);

that's the whole synopsis, and yes it's a lot, but you got this. πŸ¦‹


πŸ’… DESCRIPTION πŸ’…

so like, the Cdk scale widget? it creates a scale box, right? with a label and a scale field. that's the whole vibe. 🌸

and then the following functions? they create or manipulate the Cdk scale box widget. periodt. πŸ‘‘

it's giving interactive slider realness, and we're obsessed. πŸ’–

✨ AVAILABLE FUNCTIONS ✨

activateCDKScale

okay so bestie, this one activates the scale widget and lets the user actually interact with it πŸ’…

  • the parameter scale is a pointer to a non-NULL scale widget.
  • if the actions parameter gets passed with a non-NULL value, the characters in that array will be injected into the widget.

if you wanna activate the widget interactively, pass in a NULL pointer for actions 🫢

if the character entered into this widget is RETURN or TAB then this function will return a value from the low value to the high value. It will also set the widget data exitType to vNORMAL.

if the character entered into this widget was ESCAPE then the widget will return the unknownInt value (see the cdk_objs.h header file).

the widget data exitType will be set to vESCAPE_HIT.


destroyCDKScale

removes the widget from the screen and frees the memory the object used 🧚 it's giving cleanup era, no cap.


drawCDKScale

draws the scale widget on the screen ✨

if the box parameter is true, the widget is drawn with a box.


eraseCDKScale

removes the widget from the screen. this does NOT destroy the widget πŸ’€ so like, it's just hiding, not gone-gone.


getCDKScaleBox

returns whether the widget will be drawn with a box around it πŸ‘‘


getCDKScaleHighValue

returns the high value of the scale widget.


getCDKScaleLowValue

returns the low value of the scale widget.


getCDKScaleValue

returns the current value of the widget ⭐


injectCDKScale

injects a single character into the widget. one (1) lil character. iconic behavior honestly.

  • the parameter scale is a pointer to a non-NULL scale widget.
  • the parameter character is the character to inject into the widget.

the return value and side-effect (setting the widget data exitType) depend upon the injected character:

  • RETURN or TAB β€” the function returns a value ranging from the scale's low value to the scale's high value. the widget data exitType is set to vNORMAL.
  • ESCAPE β€” the function returns the unknownInt value (see the cdk_objs.h header file). the widget data exitType is set to vESCAPE_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.

moveCDKScale

moves the given widget to the given position πŸ¦‹

  • 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). 😭

the final parameter refresh is a boolean value which states whether the widget will get refreshed after the move.


newCDKScale

creates a pointer to a scale widget πŸŽ€ 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 scale field.
  • fieldAttribute β€” is the attribute of the characters displayed 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 scale 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 πŸ™ˆ


positionCDKScale

allows the user to move the widget around the screen via the cursor/keypad keys πŸ•ΉοΈ see cdk_position (3) for key bindings.


setCDKScale

lets the programmer modify certain elements of an existing scale widget πŸ’œ

the parameter names correspond to the same parameter names listed in the newCDKScale function.


setCDKScaleBackgroundAttrib

sets the background attribute of the widget.

the parameter attribute is a curses attribute, e.g., A_BOLD.


setCDKScaleBackgroundColor

sets the background color of the widget 🌈

the parameter color is in the format of the Cdk format strings.

see cdk_display (3).


setCDKScaleBox

sets whether the widget will be drawn with a box around it.


setCDKScaleBoxAttribute

sets the attribute of the box.


setCDKScaleHorizontalChar

sets the horizontal drawing character for the box to the given character.


setCDKScaleLLChar

sets the lower left hand corner of the widget's box to the given character.


setCDKScaleLRChar

sets the lower right hand corner of the widget's box to the given character.


setCDKScaleLowHigh

sets the low and high values of the widget.


setCDKScalePostProcess

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).


setCDKScalePreProcess

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).


setCDKScaleULChar

sets the upper left hand corner of the widget's box to the given character.


setCDKScaleURChar

sets the upper right hand corner of the widget's box to the given character.


setCDKScaleValue

sets the current value of the widget.


setCDKScaleVerticalChar

sets the vertical drawing character for the box to the given character.

⌨️ KEY BINDINGS ⌨️

Okay so when the widget gets activated (main character moment πŸ’…), there's a whole set of default key bindings that help you enter or manipulate the info fast. Here's the rundown, key by key β€” no cap, this is the whole table, bestie:

  • Down Arrow β€” decrements the scale by the normal value.
  • Up Arrow β€” increments the scale by the normal value.
  • u β€” increments the scale by the normal value.
  • Prev Page β€” decrements the scale by the accelerated value.
  • U β€” decrements the scale by the accelerated value.
  • Ctrl-B β€” decrements the scale by the accelerated value.
  • Next Page β€” increments the scale by the accelerated value.
  • Ctrl-F β€” increments the scale by the accelerated value.
  • Home β€” sets the scale to the low value.
  • g β€” sets the scale to the low value.
  • ^ β€” sets the scale to the low value.
  • End β€” sets the scale to the high value.
  • G β€” sets the scale to the high value.
  • $ β€” sets the scale to the high value.
  • Return β€” exits the widget and returns the index of the selected value. This also sets the widget data exitType to vNORMAL.
  • Tab β€” exits the widget and returns the index of the selected value. This also sets the widget data exitType to vNORMAL.
  • Escape β€” exits the widget and returns the unknownInt value (see the cdk_objs.h header file). This also sets the widget data exitType to vESCAPE_HIT.
  • Ctrl-R β€” refreshes the screen.

Now plot twist: if the cursor is not pointing to the field's value, a whole different little binding squad takes over. 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 sign. Cute, right? 🌸

  • 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 a wrap on cdk_scale(3), bestie 🫢 this version is from 2025-10-13, filed under the name cdk_scale(3) β€” go forth and scale things, you absolute icon πŸ‘‘πŸ’–