TICKIT_PEN_NEW(3)
β¨ TICKIT_PEN_NEW(3) β Library Functions Manual β¨
okay so bestie, welcome to the TICKIT_PEN_NEW page π
this is one of those little section-3 numbers from the Library Functions Manual, and it's literally all about making brand-new pen instances. pens. for your terminal. yes queen, styling your TUI is a whole aesthetic π
πΈ NAME πΈ
tickit_pen_new β create a new pen instance
π¦ SYNOPSIS π¦
#include <tickit.h>
TickitPen *tickit_pen_new(void);
TickitPen *tickit_pen_new_attrs(...);
TickitPen *tickit_pen_clone(const TickitPen *orig);
Link with -ltickit.
π DESCRIPTION π
so like, three different ways to birth a pen, each with its own vibe:
tickit_pen_new()β makes you a fresh newTickitPeninstance. it starts out with absolutely no attributes set, like a blank canvas bestie, a clean face before the makeup π§tickit_pen_new_attrs()β makes a newTickitPeninstance and fills it up with a whole list of attribute values you hand it. the attributes come in pairs: first aTickitPenAttr, then an integer giving its value, and the whole thing gets terminated by a final0or-1. periodt.
also there's a little plot twist here β two extra attribute types get recognised in this function: TICKIT_PEN_FG_DESC and TICKIT_PEN_BG_DESC. those two are expecting a string argument value instead, and that string gets parsed exactly like it would for tickit_pen_set_colour_attr_desc(3).
tickit_pen_clone()β makes a newTickitPeninstance that starts out with the same attribute values set as the one you passed in asorig. it's giving twin energy fr fr π―
okay so about the refcount, listen up: the reference count of a newly-constructed pen instance is one. you can bump it up or bring it down withtickit_pen_ref(3)andtickit_pen_unref(3). and the moment that reference count hits zero, the pen is destroyed. gone. bye. π
π₯ RETURN VALUE π₯
if everything goes right, tickit_pen_new(), tickit_pen_new_attrs() and tickit_pen_clone() all return a pointer to the shiny new instance. π«Ά
if it goes wrong? you get NULL back, and errno is set to tell you what the failure was. no cap.
π SEE ALSO π
tickit_pen_ref(3), tickit_pen_unref(3), tickit_pen_bind_event(3), tickit_pen(7), tickit(7)
aaaand that's the whole page bestie, go forth and style your terminal ππ
later, icon β this was TICKIT_PEN_NEW(3) from the Library Functions Manual, page three, and yes it slayed β¨
π¦ where this page comes from
- alpine 3.24: libtickit-doc 0.4.6-r0 Β· MIT
- debian bookworm: libtickit-dev 0.4.3-1 Β· MIT
- debian trixie: libtickit-dev 0.4.3-2 Β· MIT
- fedora 43: libtickit-devel 0.4.5-2.fc43 Β· MIT
- fedora 43: libtickit-devel 0.4.5-2.fc43 Β· MIT
- fedora 44: libtickit-devel 0.4.5-3.fc44 Β· MIT
- fedora 44: libtickit-devel 0.4.5-3.fc44 Β· MIT
- nixos 26.05: libtickit 0.4.5
- nixpkgs unstable: libtickit 0.4.6
- ubuntu jammy: libtickit-dev 0.4.1-1 Β· MIT
- ubuntu noble: libtickit-dev 0.4.3-1.1build1 Β· MIT
- ubuntu questing: libtickit-dev 0.4.3-2
- ubuntu resolute: libtickit-dev 0.4.3-2build1 Β· MIT
- ubuntu stonking: libtickit-dev 0.4.3-2build1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms