cdk_fscale(3)
πΈ cdk_fscale β the manual page, bestie edition πΈ
okay so you're here for cdk_fscale(3), which is a Cdk library call, and honestly? she's iconic. it's giving "slider widget but make it float." let's get into it, no cap. π
β¨ NAME β¨
cdk_fscale β the Cdk scale widget, but the float one π«Ά
like yes there's a regular scale widget and then there's THIS one, and this one deals in floats. she's precise. she's delicate. she's got decimals. periodt.
β¨ SYNOPSIS β¨
first things first, you gotta link against the library, and you gotta include the header. the vibe is:
cc [ flag ... ] file ... -lcdk [ library ... ]
#include <cdk.h>
and now the whole cast of characters, every single one, verbatim, because we do NOT skip anyone in this house π:
float activateCDKFScale (
CDKFSCALE *scale,
chtype *actions);
void destroyCDKFScale (
CDKFSCALE *scale);
void drawCDKFScale (
CDKFSCALE *scale,
boolean box);
void eraseCDKFScale (
CDKFSCALE *scale);
boolean getCDKFScaleBox (
CDKFSCALE *scale);
int getCDKFScaleDigits (
CDKFSCALE *scale);
float getCDKFScaleHighValue (
CDKFSCALE *scale);
float getCDKFScaleLowValue (
CDKFSCALE *scale);
float getCDKFScaleValue (
CDKFSCALE *scale);
int injectCDKFScale (
CDKFSCALE *scale,
chtype input);
void moveCDKFScale (
CDKFSCALE *scale,
int xpos,
int ypos,
boolean relative,
boolean refresh);
CDKFSCALE *newCDKFScale (
CDKSCREEN *cdkscreen,
int xpos,
int ypos,
const char *title,
const char *label,
chtype fieldAttribute,
int fieldWidth,
float currentValue,
float lowValue,
float highValue,
float increment,
float fastIncrement,
int digits,
boolean box,
boolean shadow);
void positionCDKFScale (
CDKFSCALE *scale);
void setCDKFScale (
CDKFSCALE *scale,
float lowValue,
float highValue,
float currentValue,
boolean box);
void setCDKFScaleBackgroundAttrib (
CDKFSCALE *scale,
chtype attribute);
void setCDKFScaleBackgroundColor (
CDKFSCALE *scale,
const char * color);
void setCDKFScaleBox (
CDKFSCALE *scale,
boolean box);
void setCDKFScaleBoxAttribute (
CDKFSCALE *scale,
chtype character);
void setCDKFScaleDigits (
CDKFSCALE *scale,
int digits);
void setCDKFScaleHorizontalChar (
CDKFSCALE *scale,
chtype character);
void setCDKFScaleLLChar (
CDKFSCALE *scale,
chtype character);
void setCDKFScaleLRChar (
CDKFSCALE *scale,
chtype character);
void setCDKFScaleLowHigh (
CDKFSCALE *scale,
float low,
float high);
void setCDKFScalePostProcess (
CDKFSCALE *scale,
PROCESSFN callback,
void * data);
void setCDKFScalePreProcess (
CDKFSCALE *scale,
PROCESSFN callback,
void * data);
void setCDKFScaleULChar (
CDKFSCALE *scale,
chtype character);
void setCDKFScaleURChar (
CDKFSCALE *scale,
chtype character);
void setCDKFScaleValue (
CDKFSCALE *scale,
float value);
void setCDKFScaleVerticalChar (
CDKFSCALE *scale,
chtype character);
ok that's a LOT of functions and honestly? she deserves it. main character energy fr fr π
β¨ DESCRIPTION β¨
so here's the tea β β the Cdk scale widget creates a scale box. and that scale box has a label and a scale field. that's the whole concept. a lil box. a lil label. a lil scale. and you can drag that scale around to pick a value. it's giving "volume slider but in a terminal." obsessed.
the following functions create or manipulate the Cdk scale box widget. that's it, that's the description, and everything else is just the details of how, which is coming up next bestie π¦
no, we are not done β this page is long and she's got more to say. keep scrolling, the rest is coming π
β¨ AVAILABLE FUNCTIONS β¨
okay bestie, this is the whole squad of functions that come with the scale widget. we're going through every single one, no skips, no cap. π
activateCDKFScale
wakes up the scale widget and lets the user interact with it. β¨
- The parameter
scaleis a pointer to a non-NULLscale widget. - If the
actionsparameter is passed with a non-NULLvalue, 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 unknownFloat value (see the cdk_objs.h header file).
The widget data exitType will be set to vESCAPE_HIT.
bestie, thatunknownFloatis living incdk_objs.h, so peek there if you need the details. π«Ά
destroyCDKFScale
removes the widget from the screen and frees the memory the object used. π it's giving cleanup era.
drawCDKFScale
draws the scale widget on the screen. π¨
If the box parameter is true, the widget is drawn with a box.
eraseCDKFScale
removes the widget from the screen. this does NOT destroy the widget. π
getCDKFScaleBox
returns whether the widget will be drawn with a box around it. π¦
getCDKFScaleDigits
returns the number of digits shown after the decimal point for the box value. π’
getCDKFScaleHighValue
returns the high value of the scale widget. β¬οΈ
getCDKFScaleLowValue
returns the low value of the scale widget. β¬οΈ
getCDKFScaleValue
returns the current value of the widget. β
injectCDKFScale
injects a single character into the widget. π
- The parameter
scaleis a pointer to a non-NULLscale 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 theunknownFloatvalue (see thecdk_objs.hheader file). The widget dataexitTypeis set tovESCAPE_HIT.- Otherwise β unless modified by preprocessing, postprocessing or key bindings, the function returns the
unknownFloatvalue (see thecdk_objs.hheader file). The widget dataexitTypeis set tovEARLY_EXIT.
moveCDKFScale
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 values TOP, BOTTOM, LEFT, RIGHT, or CENTER when relative = TRUE. (weird things may happen). The final parameter refresh is a boolean value which states whether the widget will get refreshed after the move.
newCDKFScale
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.
positionCDKFScale
allows the user to move the widget around the screen via the cursor/keypad keys. πΉοΈ See cdk_position (3) for key bindings.
setCDKFScale
lets the programmer modify certain elements of an existing scale widget. π οΈ
The parameter names correspond to the same parameter names listed in the newCDKFScale function.
setCDKFScaleBackgroundAttrib
sets the background attribute of the widget. π¨
The parameter attribute is a curses attribute, e.g., A_BOLD.
setCDKFScaleBackgroundColor
sets the background color of the widget. π
The parameter color is in the format of the Cdk format strings.
See cdk_display (3).
setCDKFScaleBox
sets whether the widget will be drawn with a box around it. π¦
setCDKFScaleBoxAttribute
sets the attribute of the box. β¨
setCDKFScaleDigits
sets the number of digits shown after the decimal point for the box value. π’
setCDKFScaleHorizontalChar
sets the horizontal drawing character for the box to the given character. β
setCDKFScaleLLChar
sets the lower left hand corner of the widget's box to the given character. βοΈ
setCDKFScaleLRChar
sets the lower right hand corner of the widget's box to the given character. βΆοΈ
setCDKFScaleLowHigh
sets the low and high values of the widget. β¬οΈβ¬οΈ
setCDKFScalePostProcess
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).
setCDKFScalePreProcess
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).
setCDKFScaleULChar
sets the upper left hand corner of the widget's box to the given character. β€
setCDKFScaleURChar
sets the upper right hand corner of the widget's box to the given character. β₯
setCDKFScaleValue
sets the current value of the widget. β
setCDKFScaleVerticalChar
sets the vertical drawing character for the box to the given character. β
β¨ KEY BINDINGS β¨
Okay bestie, so once the widget is activated, it comes preloaded with a whole set of default key bindings that let you enter or manipulate the info fast. Here's the rundown of every key and exactly what it does for this widget. No skips, no shortcuts, we're covering all of them π
- 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
unknownFloatvalue (see thecdk_objs.hheader file). This also sets the widget dataexitTypetovESCAPE_HIT. Ctrl-Rβ Refreshes the screen.
If the cursor is not pointing at the field's value, a different little crew of key bindings takes over π 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 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 the whole page, bestie β you ate that π«Ά This one's cdk_fscale(3) from 2025-10-13, so go forth and scale things gorgeously πβ¨
π¦ 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