This demo creates a GdkPixmap and draws on it using functions like draw_rectangle, draw_layout (for Pango layouts).
The code is interesting as it uses quite a few low level functions, accesses to structure elements and so forth. The following function is called to create the pixmap at a given size after size change of the window:
<%= copy_function("examples/pixmap.lua", "on_configure") %>