cdk_screen(3)
π cdk_screen β Library calls π
okay bestie, so this is the cdk_screen(3) page from the Cdk manual, and it's literally the β¨management eraβ¨ of Cdk. Buckle up, we're doing screens and widgets today π
πΈ NAME πΈ
cdk_screen β Cdk screen and widget manipulation functions
β¨ SYNOPSIS β¨
cc [ flag ... ] file ... -lcdk [ library ... ]
#include <cdk.h>
void destroyCDKScreen(
CDKSCREEN *screen);
void endCDK(void) ;
void eraseCDKScreen(
CDKSCREEN *screen);
void initCDKColor (void) ;
CDKSCREEN *initCDKScreen (
WINDOW *cursesWindow);
void lowerCDKObject(
EObjectType widgetType,
void *object);
void raiseCDKObject(
EObjectType widgetType,
void *object);
void refreshCDKScreen(
CDKSCREEN *screen);
void registerCDKObject (
CDKSCREEN *screen,
EObjectType widgetType,
void *object);
void unregisterCDKObject(
EObjectType widgetType,
void *object);
π¦ DESCRIPTION π¦
Cdk is out here managing all of your widgets for you, no cap. These functions are the ones doing the actual management of the widgets living on a screen. Like, they're the backstage crew of your terminal UI. π
π AVAILABLE FUNCTIONS π
destroyCDKScreen
frees any memory that the Cdk screen pointer allocated. bye bye memory leak, we don't know her π
endCDK
cleans up any memory created by starting Cdk, and shuts down curses. it's the goodbye-hug function π«Ά
eraseCDKScreen
erases all of the widgets currently associated with the given screen. This does NOT destroy the widgets. they're just invisible besties, still very much alive β¨
initCDKColor
starts the Cdk color capabilities. it defines 64 color pairs, each one accessible using the COLOR_PAIR macro. and if you don't have color support? this function call makes no difference, it's just vibing π
initCDKScreen
takes a WINDOW* parameter, cursesWindow, and returns a pointer to a CDKSCREEN.
since every single widget takes a CDKSCREEN pointer as its first argument, this is one of the first calls you make. main character energy, obviously π
if the cursesWindow parameter is a null pointer, initCDKScreen initializes curses and replaces the parameter with stdscr. otherwise, it assumes your application has already initialized the locale and then called initscr.
either way, the (possibly updated) cursesWindow parameter is used as the window for the CDKSCREEN result. cute, right? π
lowerCDKObject
has the opposite effect of the raiseCDKObject function call. that's it, that's the function πΈ
raiseCDKObject
raises the widget to the top of the screen. so if there are widgets overlapping the given object when a refresh happens, calling this function has the effect of raising the object so no other widgets obstruct it. it's giving "excuse me, I'm the main event" π
- The
widgetTypeparameter states what Cdk widget type this object is. - The
objectparameter is a void pointer to the object.
refreshCDKScreen
redraws all of the widgets currently associated with the given screen. glow-up round two β¨
registerCDKObject
is called automatically when a widget is created. so if for some reason an object does get unregistered β like, say, by calling unregisterCDKObject β the widget can be registered again by calling this function. it's the re-follow, bestie π«Ά
- The
widgetTypeparameter states what Cdk widget type this object is. - The
objectparameter is a void pointer to the object.
unregisterCDKObject
removes the widget from the screen. This does NOT destroy the object β it just removes the widget from any further refreshes by the function refreshCDKScreen. ghosting, but make it functional π
- The
widgetTypeparameter states what Cdk widget type this object is. - The
objectparameter is a void pointer to the object.
π₯ SEE ALSO π₯
cdk(3), cdk_binding(3), cdk_display(3)
and that's the whole page, bestie, you ate that π β¨ this was cdk_screen(3) from the Library calls manual, dated 2024-03-28. go forth and manage those widgets, ily ππ¦π
π¦ where this page comes from
- debian trixie: libcdk5-dev 5.0.20250116-1 Β· BSD-4-Clause
- fedora 43: cdk 5.0.20240619-4.fc43 Β· LicenseRef-Callaway-BSD-with-advertising
- fedora 43: cdk 5.0.20240619-4.fc43 Β· LicenseRef-Callaway-BSD-with-advertising
- 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 questing: libcdk5-dev 5.0.20250116-1
- 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