cdk_<MODEL>scale(3)

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

✨ cdk_<MODEL>scale(3) ✨ β€” Library calls, bestie πŸ’…

okay so welcome to the cdk_<MODEL>scale page, it's giving Library calls, and it's a whole vibe. this one is part 1 of 3 so buckle up, we're just doing the setup here 🫢


πŸŽ€ NAME πŸŽ€

cdk_<MODEL>scale β€” the Cdk scale widget (type <CTYPE>) 🌸


πŸ¦‹ SYNOPSIS πŸ¦‹

bestie. the include. the link. the whole ritual. no cap, it goes like this:

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

#include <cdk.h>

<CTYPE> activateCDK<MIXED> (
               CDK<UPPER> *scale,
               chtype *actions);

void destroyCDK<MIXED> (
               CDK<UPPER> *scale);

void drawCDK<MIXED> (
               CDK<UPPER> *scale,
               boolean box);

void eraseCDK<MIXED> (
               CDK<UPPER> *scale);

boolean getCDK<MIXED>Box (
               CDK<UPPER> *scale);
               #if <FLOAT>

int getCDK<MIXED>Digits (
               CDK<UPPER> *scale);
               #endif <FLOAT>

<CTYPE> getCDK<MIXED>HighValue (
               CDK<UPPER> *scale);

<CTYPE> getCDK<MIXED>LowValue (
               CDK<UPPER> *scale);

<CTYPE> getCDK<MIXED>Value (
               CDK<UPPER> *scale);

int injectCDK<MIXED> (
               CDK<UPPER> *scale,
               chtype input);

void moveCDK<MIXED> (
               CDK<UPPER> *scale,
               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 fieldAttribute,
               int fieldWidth,
               <CTYPE> currentValue,
               <CTYPE> lowValue,
               <CTYPE> highValue,
               <CTYPE> increment,
               <CTYPE> fastIncrement,
               #if <FLOAT>
               int digits,
               #endif <FLOAT>
               boolean box,
               boolean shadow);

void positionCDK<MIXED> (
               CDK<UPPER> *scale);

void setCDK<MIXED> (
               CDK<UPPER> *scale,
               <CTYPE> lowValue,
               <CTYPE> highValue,
               <CTYPE> currentValue,
               boolean box);

void setCDK<MIXED>BackgroundAttrib (
               CDK<UPPER> *scale,
               chtype attribute);

void setCDK<MIXED>BackgroundColor (
               CDK<UPPER> *scale,
               const char * color);

void setCDK<MIXED>Box (
               CDK<UPPER> *scale,
               boolean box);

void setCDK<MIXED>BoxAttribute (
               CDK<UPPER> *scale,
               chtype character);
               #if <FLOAT>

void setCDK<MIXED>Digits (
               CDK<UPPER> *scale,
               int digits);
               #endif <FLOAT>

void setCDK<MIXED>HorizontalChar (
               CDK<UPPER> *scale,
               chtype character);

void setCDK<MIXED>LLChar (
               CDK<UPPER> *scale,
               chtype character);

void setCDK<MIXED>LRChar (
               CDK<UPPER> *scale,
               chtype character);

void setCDK<MIXED>LowHigh (
               CDK<UPPER> *scale,
               <CTYPE> low,
               <CTYPE> high);

void setCDK<MIXED>PostProcess (
               CDK<UPPER> *scale,
               PROCESSFN callback,
               void * data);

void setCDK<MIXED>PreProcess (
               CDK<UPPER> *scale,
               PROCESSFN callback,
               void * data);

void setCDK<MIXED>ULChar (
               CDK<UPPER> *scale,
               chtype character);

void setCDK<MIXED>URChar (
               CDK<UPPER> *scale,
               chtype character);

void setCDK<MIXED>Value (
               CDK<UPPER> *scale,
               <CTYPE> value);

void setCDK<MIXED>VerticalChar (
               CDK<UPPER> *scale,
               chtype character);

🌈 the full cast, so you know who's who 🌈

like, here's everyone that walked into the group chat, in the exact order they showed up πŸ‘‘

  1. activateCDK<MIXED>
  2. destroyCDK<MIXED>
  3. drawCDK<MIXED>
  4. eraseCDK<MIXED>
  5. getCDK<MIXED>Box
  6. getCDK<MIXED>Digits
  7. getCDK<MIXED>HighValue
  8. getCDK<MIXED>LowValue
  9. getCDK<MIXED>Value
  10. injectCDK<MIXED>
  11. moveCDK<MIXED>
  12. newCDK<MIXED>
  13. positionCDK<MIXED>
  14. setCDK<MIXED>
  15. setCDK<MIXED>BackgroundAttrib
  16. setCDK<MIXED>BackgroundColor
  17. setCDK<MIXED>Box
  18. setCDK<MIXED>BoxAttribute
  19. setCDK<MIXED>Digits
  20. setCDK<MIXED>HorizontalChar
  21. setCDK<MIXED>LLChar
  22. setCDK<MIXED>LRChar
  23. setCDK<MIXED>LowHigh
  24. setCDK<MIXED>PostProcess
  25. setCDK<MIXED>PreProcess
  26. setCDK<MIXED>ULChar
  27. setCDK<MIXED>URChar
  28. setCDK<MIXED>Value
  29. setCDK<MIXED>VerticalChar
πŸ’€ not me noticing getCDK<MIXED>Digits and setCDK<MIXED>Digits are wrapped in #if <FLOAT> / #endif <FLOAT> β€” yes bestie, they're conditional, they only exist when that's a thing. don't come for me, that's literally what it says.

πŸ’œ DESCRIPTION πŸ’œ

so. the Cdk scale widget creates a scale box with a label and a scale field. that's the whole lewk, and it ate πŸ’…βœ¨

and the functions listed above? those are the ones that create or manipulate the Cdk scale box widget. every single one of them is in the cast list, no one got left out, we don't do that here 🫢


and that's the setup bestie β€” we're just getting started, the rest of the scale widget lore is literally right there πŸ‘€

✨ AVAILABLE FUNCTIONS ✨


activateCDK<MIXED> πŸ’–

okay bestie this is the one that actually starts the party β€” it activates the scale widget and lets the user interact with it.

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

To 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 unknown<DTYPE> value (see the cdk_objs.h header file).

The widget data exitType will be set to vESCAPE_HIT. periodt. πŸ’…

destroyCDK<MIXED> 🫢

removes the widget from the screen and frees memory the object used. it's the goodbye forever function β€” no coming back from this one.


drawCDK<MIXED> ✨

draws the scale widget on the screen.

If the box parameter is true, the widget is drawn with a box. that's it, that's the whole function, and honestly? iconic.


eraseCDK<MIXED> 🧚

removes the widget from the screen. This does NOT destroy the widget.

like... it's just hiding, not deleting. the widget is still there, lurking, waiting for its moment. main character energy honestly.


getCDK<MIXED>Box πŸ“¦

returns whether 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 scale widget.


getCDK<MIXED>LowValue 🌸

returns the low value of the scale widget.


getCDK<MIXED>Value πŸ’œ

returns the current value of the widget.


injectCDK<MIXED> πŸ’‰

injects a single character into the widget. like you're just feeding it a keystroke by hand, no keyboard required.

  • 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 unknown<DTYPE> 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 unknown<DTYPE> value (see the cdk_objs.h header file). The widget data exitType is set to vEARLY_EXIT.

moveCDK<MIXED> πŸ¦‹

moves the given widget to the given position. relocation era.

  • 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). fr fr, don't do it. 😭

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


newCDK<MIXED> πŸ‘‘

creates a pointer to a scale widget. the birth of a legend. 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.


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 scale widget.

The parameter names correspond to the same parameter names listed in the newCDK<MIXED> function. easy.


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.


setCDK<MIXED>BoxAttribute ✨

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.


setCDK<MIXED>LRChar 🦢

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


setCDK<MIXED>LowHigh πŸ“ˆ

sets the low and high values of the widget.


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.


setCDK<MIXED>VerticalChar βž•

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

⌨️ KEY BINDINGS ⌨️

okay bestie so once the widget is activated (like, it's got the spotlight, main character moment) there's a whole set of default key bindings ready to help you enter and manipulate the info fast. here's the rundown of every key and what it does for this widget πŸ’…

  • 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 unknown<DTYPE> value (peep the cdk_objs.h header file for that one). this also sets the widget data exitType to vESCAPE_HIT.
  • Ctrl-R β€” refreshes the screen. ✨

πŸ¦‹ when the cursor is not on the field's value πŸ¦‹

so if the cursor is not pointing to the field's value, these key bindings apply instead. 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. 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.
ngl, note that the normal-value and accelerated-value moves are not the same amount β€” that's the whole point of having both, bestie. normal is your lil baby step, accelerated is the zoom πŸƒβ™€οΈπŸ’¨

πŸ‘€ SEE ALSO πŸ‘€

go read these next, fr fr:


that's a wrap on cdk_<MODEL>scale(3) bestie!! this page came from the 2025-10-13 source version, and you made it all the way to the end which is so slay of you πŸŽ€ go forth and scale your little heart out, i'm obsessed πŸ’–πŸ¦‹βœ¨

πŸ“¦ where this page comes from