Cdk(3)
β¨ NAME β¨
cdk β the Curses Development Kit π
π SYNOPSIS π
cc [ flag ... ] file ... -lcdk [ library ... ]
#include <cdk.h>
okay so here's the deal, bestie π
Cdk hands you functions for a whole pile of pre-made curses widgets. To actually use them you gotta pull in the header file, cdk.h, into your source. No header, no widgets, no vibes. π
The widgets you get from Cdk are listed below:
- Alphalist β
cdk_alphalist(3) - Button β
cdk_button(3) - Buttonbox β
cdk_buttonbox(3) - Calendar β
cdk_calendar(3) - Dialog β
cdk_dialog(3) - DoubleFloat Scale β
cdk_dscale(3) - Entry Field β
cdk_entry(3) - File Selector β
cdk_fselect(3) - File Viewer β
cdk_viewer(3) - Floating Scale β
cdk_fscale(3) - Floating Slider β
cdk_fslider(3) - Graph β
cdk_graph(3) - Histogram β
cdk_histogram(3) - Integer Scale β
cdk_scale(3) - Integer Slider β
cdk_slider(3) - Item List β
cdk_itemlist(3) - Label β
cdk_label(3) - Marquee β
cdk_marquee(3) - Matrix β
cdk_matrix(3) - Multiple Line Entry Field β
cdk_mentry(3) - Pulldown Menu β
cdk_menu(3) - Radio List β
cdk_radio(3) - Scrolling List β
cdk_scroll(3) - Scrolling Selection List β
cdk_selection(3) - Scrolling Window β
cdk_swindow(3) - Template β
cdk_template(3) - Unsigned Scale β
cdk_uscale(3) - Unsigned Slider β
cdk_uslider(3)
and the rest of the manual pages? they're all about the supporting functions π«Ά
cdk_binding(3)β lays out how you create user definable key bindings β¨cdk_display(3)β shows you how to drop special display attributes, colors, and justification into a widget πcdk_draw(3)β the rundown on the functions used for drawing text and lines βοΈcdk_screen(3)β demonstrates using screens inside Cdk π₯οΈcdk_misc(3)β the miscellaneous functions that ship with the Cdk library πcdk_process(3)β demonstrates the pre- and post-process function class, iykyk π
π DESCRIPTION π
Cdk is a library of functions that lets a programmer spin up a full screen interactive program, fast and with ease. Fr fr, it's giving convenience. The Cdk widgets come with the following features:
- Ncurses library. Instead of the standard curses library, Cdk can take full advantage of the colors Ncurses brings to the table π. Wanna learn how to flex Cdk's color capabilities? Go see
cdk_display(3). - Key Bindings. Individual keys can be overridden with a callback. You set that callback up with the
bindCDKObjectfunction π. More on this incdk_binding(3). - Pre and Post Processing. Certain widgets let the user trap a character before and after that character gets applied to the widget. That's how programmers "filter" character input π§. More on this in
cdk_process(3). - Self Test Widgets. Using the inject function class plus the activate function, programmers can make widgets test themselves π€. That means you can run automated tests on a final program. obsessed.
- Special Display Formats There are special character format commands you can insert into any string in Cdk, and the contents get mapped to a
chtype(peep the curses manual page) with character attributes β¨. So if you want, you can put format types on each individual character. yes, each one. - The Ability To Build Predefined Screens Widgets can be associated with any given screen. If more than one screen is defined, Cdk can "flip" from one screen to another with ease π¦. The
cdk_screenmanual page has the details.
π STANDARD WIDGET BEHAVIOR π
Every single widget has a member of the structure called exitType. This member tells you how the widget exited. The page says there are three values to check forβ¦ and then serves five, and honestly? we love a generous queen π
. Anyway, here they all are:
vNORMALβ the widget exited normally. This value gets set when the widget is handed the characters TAB or RETURN.vEARLY_EXITβ the widget exited early. This value gets set when characters like TAB or RETURN are injected into the widget via theinjectCDKXXXfunction and the character that got injected does not exit the widget.vERRORβ this one means an error came back from curses, e.g., if the terminal got disconnected π.vESCAPE_HITβ the user hit ESCAPE to leave the widget.vNEVER_ACTIVATEDβ this is the initial state of the value. It means the widget hasn't been activated yet π.
πΈ NOTES πΈ
The header file <cdk.h> automatically includes the header files <curses.h>, <stdlib.h>, <string.h>, <ctype.h>, <unistd.h>, <dirent.h>, <time.h>, <errno.h>, <pwd.h>, <grp.h>, <sys/stat.h>, and <sys/types.h>. and the <curses.h> header file includes <stdio.h> and <unctrl.h>. one header to rule them all, no cap π
π₯ SEE ALSO π₯
cdk_binding(3), cdk_display(3), cdk_draw(3), cdk_misc(3), cdk_process(3), cdk_screen(3)
and that's the whole page, bestie π this one's from Cdk(3), the Library calls section, dated 2025-01-14. go build something iconic with it, you've got this π«Άβ¨
π¦ where this page comes from
- debian trixie: libcdk5-dev 5.0.20250116-1 Β· BSD-4-Clause
- 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