cdk_uscale(3)
πΈ NAME πΈ
okay so bestie, you're reading the man page for cdk_uscale β that's the Cdk scale widget (type unsigned) β¨. Section 3 of the manual, the Library calls corner of the world, and honestly? iconic. periodt.
π SYNOPSIS π
first things first, how do you even get this thing into your program? like this:
cc [ flag ... ] file ... -lcdk [ library ... ]
#include <cdk.h>
and then, boom, the whole squad of functions π«Ά:
unsigned activateCDKUScale (
CDKUSCALE *scale,
chtype *actions);
void destroyCDKUScale (
CDKUSCALE *scale);
void drawCDKUScale (
CDKUSCALE *scale,
boolean box);
void eraseCDKUScale (
CDKUSCALE *scale);
boolean getCDKUScaleBox (
CDKUSCALE *scale);
unsigned getCDKUScaleHighValue (
CDKUSCALE *scale);
unsigned getCDKUScaleLowValue (
CDKUSCALE *scale);
unsigned getCDKUScaleValue (
CDKUSCALE *scale);
int injectCDKUScale (
CDKUSCALE *scale,
chtype input);
void moveCDKUScale (
CDKUSCALE *scale,
int xpos,
int ypos,
boolean relative,
boolean refresh);
CDKUSCALE *newCDKUScale (
CDKSCREEN *cdkscreen,
int xpos,
int ypos,
const char *title,
const char *label,
chtype fieldAttribute,
int fieldWidth,
unsigned currentValue,
unsigned lowValue,
unsigned highValue,
unsigned increment,
unsigned fastIncrement,
boolean box,
boolean shadow);
void positionCDKUScale (
CDKUSCALE *scale);
void setCDKUScale (
CDKUSCALE *scale,
unsigned lowValue,
unsigned highValue,
unsigned currentValue,
boolean box);
void setCDKUScaleBackgroundAttrib (
CDKUSCALE *scale,
chtype attribute);
void setCDKUScaleBackgroundColor (
CDKUSCALE *scale,
const char * color);
void setCDKUScaleBox (
CDKUSCALE *scale,
boolean box);
void setCDKUScaleBoxAttribute (
CDKUSCALE *scale,
chtype character);
void setCDKUScaleHorizontalChar (
CDKUSCALE *scale,
chtype character);
void setCDKUScaleLLChar (
CDKUSCALE *scale,
chtype character);
void setCDKUScaleLRChar (
CDKUSCALE *scale,
chtype character);
void setCDKUScaleLowHigh (
CDKUSCALE *scale,
unsigned low,
unsigned high);
void setCDKUScalePostProcess (
CDKUSCALE *scale,
PROCESSFN callback,
void * data);
void setCDKUScalePreProcess (
CDKUSCALE *scale,
PROCESSFN callback,
void * data);
void setCDKUScaleULChar (
CDKUSCALE *scale,
chtype character);
void setCDKUScaleURChar (
CDKUSCALE *scale,
chtype character);
void setCDKUScaleValue (
CDKUSCALE *scale,
unsigned value);
void setCDKUScaleVerticalChar (
CDKUSCALE *scale,
chtype character);
not me listing every single one of these, but fr fr, they're all yours and they all matter π
β¨ DESCRIPTION β¨
so here's the vibe check: the Cdk scale widget creates a scale box β like, a box with a label and a scale field inside it π. that's the whole ~aesthetic~.
and then the functions below? they're the ones that create the Cdk scale box widget or manipulate it. your main character tools, basically π
more parts are coming bestie, don't go anywhere π
β¨ AVAILABLE FUNCTIONS β¨
okay bestie, here's the whole vibe check of functions you can call on your unsigned scale widget π each one is a little tool in your toolkit, no cap.
activateCDKUScale π
activates the scale widget and lets the user interact with it. it's giving main character energy.
- 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 unknownUnsigned value (see the cdk_objs.h header file).
The widget data exitType will be set to vESCAPE_HIT.
destroyCDKUScale ποΈ
removes the widget from the screen and frees memory the object used. it's the ultimate cleanup, periodt.
drawCDKUScale π¨
draws the scale widget on the screen. if the box parameter is true, the widget is drawn with a box. iconic.
eraseCDKUScale π§½
removes the widget from the screen. this does NOT destroy the widget. so it's just hiding, not deleting, bestie.
getCDKUScaleBox π¦
returns whether the widget will be drawn with a box around it.
getCDKUScaleHighValue β¬οΈ
returns the high value of the scale widget.
getCDKUScaleLowValue β¬οΈ
returns the low value of the scale widget.
getCDKUScaleValue π―
returns the current value of the widget.
injectCDKUScale π
injects a single character into the widget. lowkey powerful.
- 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 theunknownUnsignedvalue (see thecdk_objs.hheader file). The widget dataexitTypeis set tovESCAPE_HIT.- Otherwise β unless modified by preprocessing, postprocessing or key bindings, the function returns the
unknownUnsignedvalue (see thecdk_objs.hheader file). The widget dataexitTypeis set tovEARLY_EXIT.
moveCDKUScale π
moves the given widget to the given position. slay.
- 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). The final parameterrefreshis a boolean value which states whether the widget will get refreshed after the move.
newCDKUScale β¨
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 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 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.
positionCDKUScale πΉοΈ
allows the user to move the widget around the screen via the cursor/keypad keys. See cdk_position (3) for key bindings. iykyk.
setCDKUScale π οΈ
lets the programmer modify certain elements of an existing scale widget. the parameter names correspond to the same parameter names listed in the newCDKUScale function.
setCDKUScaleBackgroundAttrib π¨
sets the background attribute of the widget. the parameter attribute is a curses attribute, e.g., A_BOLD.
setCDKUScaleBackgroundColor π
sets the background color of the widget. the parameter color is in the format of the Cdk format strings. See cdk_display (3).
setCDKUScaleBox π¦
sets whether the widget will be drawn with a box around it.
setCDKUScaleBoxAttribute ποΈ
sets the attribute of the box.
setCDKUScaleHorizontalChar β
sets the horizontal drawing character for the box to the given character.
setCDKUScaleLLChar β£
sets the lower left hand corner of the widget's box to the given character.
setCDKUScaleLRChar β’
sets the lower right hand corner of the widget's box to the given character.
setCDKUScaleLowHigh π½πΌ
sets the low and high values of the widget.
setCDKUScalePostProcess π
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).
setCDKUScalePreProcess βͺ
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).
setCDKUScaleULChar β€
sets the upper left hand corner of the widget's box to the given character.
setCDKUScaleURChar β₯
sets the upper right hand corner of the widget's box to the given character.
setCDKUScaleValue π―
sets the current value of the widget.
setCDKUScaleVerticalChar β
sets the vertical drawing character for the box to the given character.
β¨ KEY BINDINGS β¨
okay so when the widget is activated, there are several default key bindings that literally help you enter or manipulate the information quickly. here's the whole rundown for this widget, key by key:
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 dataexitTypetovNORMAL. π«ΆTabβ exits the widget and returns the index of the selected value. This also sets the widget dataexitTypetovNORMAL. πEscapeβ exits the widget and returns theunknownUnsignedvalue (see thecdk_objs.hheader file). This also sets the widget dataexitTypetovESCAPE_HIT. πCtrl-Rβ refreshes the screen. β¨
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 modify it by typing characters to replace the digits and sign. Here's the tea:
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 π¦
that's the whole page, bestie π«Ά this page is cdk_uscale(3), dated 2025-01-14. go be iconic β¨π
π¦ 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