A damn tiny abstraction Layer to create X11 window/widgets with cairo surfaces
This repository contain the examples, to check out libxputty as plain library go to:
libxputty
Features
- easy creation of widgets and windows within the xlib windows system
- easy handling of multiple windows including multiple widgets
- easy to use main struct to handle the lifetime of all widgets and windows
- Xputty main;
- main_init(&main);
- create_windows();
- main_run(&main);
- main_quit(&main);
- easy connection to event handlers by simply overwriting the defaults with you own handlers
- double buffered cairo surfaces to enable transparent drawing on child widgets
- easy to use x/y adjustments to create your own controller widgets like sliders, knobs, buttons or a trackball
- full documented API Documentation
- static linking to create position independent applications
Here is the usual hello world:

produced by this code:
static void draw_window(void *w_, void* user_data) {
cairo_set_source_rgb (w->
crb, 1, 1, 1);
}
int main (int argc, char ** argv)
{
XStoreName(app.
dpy, w->
widget,
"Hello world");
return 0;
}
Here are a bit more advanced examples:



check out the example folder for more examples.
License
0BSD
BSD Zero Clause License