cdk_uscale(3)
πΈ cdk_uscale β the manual, bestie edition πΈ
part of the Cdk library calls β cdk_uscale(3), no cap π
β¨ NAME β¨
cdk_uscale β the Cdk scale widget (type unsigned) ποΈβ¨
π¦ SYNOPSIS π¦
cc [ flag ... ] file ... -lcdk [ library ... ]
#include <cdk.h>
okay so here's the whole cast of characters, every single one, in order, fr fr:
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);
likeβ¦ that's a LOT of functions and every single one of them is here, I did not skip a single one, bestie, I would never π
π DESCRIPTION π
The Cdk scale widget creates a scale box with a label and a scale field. π
It's giving "little slider, big feelings" β you get a box, a title situation, a label, and a value you can drag up and down. iconic behavior honestly. β
The following functions create or manipulate the Cdk scale box widget. π«Ά
heads up: this is part 1 of 3, so don't go anywhere β the option-by-option breakdown and all the juicy details are still coming π
β¨ AVAILABLE FUNCTIONS β¨
okay bestie, hereβs the whole function lineup for cdk_uscale. every single one. no skips. periodt. π
activateCDKUScale πΈ
this one activates the scale widget and lets the user interact with it. itβs the βgo be interactiveβ button, basically.
- 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
NULLpointer foractions. - if the character entered into this widget is
RETURNorTABthen this function will return a value from the low value to the high value. it will also set the widget dataexitTypetovNORMAL. - if the character entered into this widget was
ESCAPEthen the widget will return theunknownUnsignedvalue (see thecdk_objs.hheader file).
- to activate the widget interactively pass in a
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 cleanup bestie. bye π
drawCDKUScale π¨
draws the scale widget on the screen.
if the box parameter is true, the widget is drawn with a box.
eraseCDKUScale π§½
removes the widget from the screen. this does NOT destroy the widget. so like, itβs gone from view but still alive. ghosting, but make it software.
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.
- 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.
- 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 parameter refresh is 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 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.
positionCDKUScale πΉοΈ
allows the user to move the widget around the screen via the cursor/keypad keys. see cdk_position (3) for key bindings.
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's a whole bunch of default key bindings already set up to help you enter or manipulate the info super 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
unknownUnsignedvalue (see thecdk_objs.hheader file). This also sets the widget dataexitTypetovESCAPE_HIT. Ctrl-Rβ Refreshes the screen.
so if the cursor is not pointing at the field's value, these other key bindings kick in instead π¦. you can use the left/right arrows to move the cursor onto the field's value, then modify it by typing characters to replace the digits and the sign π
- 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 bestie, you ate this whole page fr fr π this one's dated 2025-10-13 and it's living in section cdk_uscale(3) β go forth and scale those values, main character energy only πβ¨
π¦ where this page comes from
- fedora 43: cdk 5.0.20251014-1.fc43 Β· X11-distribute-modifications-variant
- fedora 43: cdk 5.0.20251014-1.fc43 Β· X11-distribute-modifications-variant
- fedora 44: cdk 5.0.20251014-3.fc44 Β· X11-distribute-modifications-variant
- fedora 44: cdk 5.0.20251014-3.fc44 Β· X11-distribute-modifications-variant
- nixos 26.05: cdk 5.0-20260119
- nixpkgs unstable: cdk 5.0-20260119
- 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