cdk_scale(3)
π NAME π
cdk_scale β the Cdk scale widget, and yes bestie it's type int π
This is page cdk_scale(3) from the library calls manual, and she is iconic. Grab a snack, we're going in π
β¨ SYNOPSIS β¨
Like, here's how you actually summon her π
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);
πΈ DESCRIPTION πΈ
Okay so. The Cdk scale widget is literally this little box that shows up on your screen, and it's got a label and a scale field in it ποΈ Think of it like a slider in a settings app but it's living inside your terminal and it has main character energy.
The functions below are the whole girl squad: some of them create the Cdk scale box widget, and some of them manipulate her after she exists. That's the vibe. That's the whole assignment π
ngl bestie, if you're here you probably want the juicy details on every single one of those functions β and don't worry, we are NOT skipping a single flag, value, or default. No cap. Every detail stays, only the energy levels up β¨
Part one ends here, but the lore continues β more is coming, so don't go anywhere π¦
β¨ AVAILABLE FUNCTIONS β¨
okay bestie, here's the whole roster of functions you get to play with. every single one. no skips. π
π activateCDKScale
activates the scale widget and lets the user actually interact with it. main character moment fr.
- the parameter scale is a pointer to a non-
NULLscale widget. - if the actions parameter gets passed a non-
NULLvalue, the characters in the array get injected straight 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, this function returns a value from the low value to the high value. it also sets the widget data exitType to vNORMAL.
if the character entered into this widget was ESCAPE, the widget returns the unknownInt value (peep the cdk_objs.h header file).
the widget data exitType gets set to vESCAPE_HIT.
π§ destroyCDKScale
removes the widget from the screen and frees the memory the object was using. it's giving closure, honestly. π«Ά
πΈ drawCDKScale
draws the scale widget on the screen.
if the box parameter is true, the widget gets drawn with a box. cute little frame, we love. π
π¦ eraseCDKScale
removes the widget from the screen. this does NOT destroy the widget β she's just off-screen, not 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. the moment. the truth. β¨
π injectCDKScale
injects a single character into the widget. yes, injects. slay.
- the parameter scale is a pointer to a non-
NULLscale widget. - the parameter character is the character to inject into the widget.
the return value and the side-effect (setting the widget data exitType) depend on which character you inject:
RETURNorTABβ the function returns a value ranging from the scale's low value to the scale's high value. the widget dataexitTypeis set tovNORMAL.ESCAPEβ the function returns theunknownIntvalue (see thecdk_objs.hheader file). the widget dataexitTypeis set tovESCAPE_HIT.- Otherwise β unless it's been modified by preprocessing, postprocessing or key bindings, the function returns the
unknownIntvalue (see thecdk_objs.hheader file). the widget dataexitTypeis set tovEARLY_EXIT.
π moveCDKScale
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 valuesTOP,BOTTOM,LEFT,RIGHT, orCENTERwhenrelative = 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, bestie, listen up:
- 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 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. iykyk.
π 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 is activated (like, it's awake and it's the main character now β¨) there's a whole lil squad of default key bindings that help you enter or manipulate the info fast. here's the keys and what they do, 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. (yes, lowercase, she's shy π )- 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
exitTypetovNORMAL. βοΈ - Tab β Exits the widget and returns the index of the selected value. This also sets the widget data
exitTypetovNORMAL. - Escape β Exits the widget and returns the
unknownIntvalue (see thecdk_objs.hheader file). This also sets the widget dataexitTypetovESCAPE_HIT. π Ctrl-Rβ Refreshes the screen. π
now, plot twist π«’ if the cursor is not pointing to the field's value, a different set of key bindings takes over. 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. like, you literally just type at it. iconic behavior 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. 0οΈβ£
ngl bestie, remember that Escape hands back theunknownIntvalue β that one's in thecdk_objs.hheader file, so peek there if you're confused. she's not like the other exits. π«Ά
π SEE ALSO π
and that's the whole page, periodt π this was cdk_scale(3) from the 2025-01-14 source drop β go forth and scale things, you absolute icon ππ¦β¨
π¦ where this page comes from
- debian trixie: libcdk5-dev 5.0.20250116-1 Β· BSD-4-Clause
- ubuntu questing: libcdk5-dev 5.0.20250116-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms