cdk_screen(3)

πŸ“¦
version 5.0.20260119 Β· 3 versions
, in debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– 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 widgetType parameter states what Cdk widget type this object is.
  • The object parameter 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 widgetType parameter states what Cdk widget type this object is.
  • The object parameter 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 widgetType parameter states what Cdk widget type this object is.
  • The object parameter 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 πŸŽ€πŸ¦‹πŸ’–