cdk_<MODEL>scale(3)
β¨ 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 π
activateCDK<MIXED>destroyCDK<MIXED>drawCDK<MIXED>eraseCDK<MIXED>getCDK<MIXED>BoxgetCDK<MIXED>DigitsgetCDK<MIXED>HighValuegetCDK<MIXED>LowValuegetCDK<MIXED>ValueinjectCDK<MIXED>moveCDK<MIXED>newCDK<MIXED>positionCDK<MIXED>setCDK<MIXED>setCDK<MIXED>BackgroundAttribsetCDK<MIXED>BackgroundColorsetCDK<MIXED>BoxsetCDK<MIXED>BoxAttributesetCDK<MIXED>DigitssetCDK<MIXED>HorizontalCharsetCDK<MIXED>LLCharsetCDK<MIXED>LRCharsetCDK<MIXED>LowHighsetCDK<MIXED>PostProcesssetCDK<MIXED>PreProcesssetCDK<MIXED>ULCharsetCDK<MIXED>URCharsetCDK<MIXED>ValuesetCDK<MIXED>VerticalChar
π not me noticinggetCDK<MIXED>DigitsandsetCDK<MIXED>Digitsare 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
scaleis a pointer to a non-NULL scale widget. - If the
actionsparameter 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 dataexitTypewill be set tovESCAPE_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
scaleis a pointer to a non-NULL scale widget. - The parameter
characteris the character to inject into the widget.
The return value and side-effect (setting the widget data exitType) depend upon the injected character:
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 theunknown<DTYPE>value (see thecdk_objs.hheader file). The widget dataexitTypeis set tovESCAPE_HIT.- Otherwise β unless modified by preprocessing, postprocessing or key bindings, the function returns the
unknown<DTYPE>value (see thecdk_objs.hheader file). The widget dataexitTypeis set tovEARLY_EXIT.
moveCDK<MIXED> π¦
moves the given widget to the given position. relocation era.
- The parameters
xposandyposare 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
relativestates whether thexpos/ypospair 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). 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 valuesLEFT,RIGHT, andCENTER.yposβ controls the placement of the object along the vertical axis. It may be an integer or one of the pre-defined valuesTOP,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.lowValueandhighValueβ are the low and high values of the widget respectively.incrementβ is the regular increment valuefastIncrementβ 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
functionis the callback function. - The parameter
datapoints 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
functionis the callback function. - The parameter
datapoints 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
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
unknown<DTYPE>value (peep thecdk_objs.hheader file for that one). this also sets the widget dataexitTypetovESCAPE_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
- ubuntu resolute: libcdk5-dev 5.0.20251014-1 Β· BSD-4-Clause
- ubuntu stonking: libcdk5-dev 5.0.20260119-1 Β· BSD-4-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms