I'd like build a GUI where every single pixel is under my control (i.e. not using the standard widgets that something like GTK+ provides). Renoise is a good example of what I'm looking to produce.
Is getting down to the Xlib or XCB level the best way to go, or is it possible to achieve this with higher level frameworks like GTK+ (maybe even PyGTK)? Should I be looking at Cairo for the drawing?
I'd like to work in Python or Ruby if possible, but C is fine too.
With Clutter toolkit (or some other canvas widget/toolkit) you can build such an interface. I would not advise going to the level of Xlib/XCB or DrawingArea because it would require implementing much of generic functionality already present in canvases.
In X there is one problem with this approach which you might not have taken into consideration. The font size is measured in points (one point being 1/72 of an inch) and thus varies in (pixel) size with resolution and monitor size. The text strings will also vary in length depending on the language so it's not really possible to determine how large buttons and such need to be. The common GUI toolkits for X are designed with this in mind. Apart from that it would be easy to just write your own theme engine for GTK that draws all widgets exactly as you want them (using Cairo[1] or GDK[2]) and make your application always use that theme. Perhaps it would also be possible for your application to set the default font size (in points) based on the DPI to always get the same size in pixels (and of course not making your application translatable).
There are at least a couple of GUIs using this pixel perfect approach based on SDL[3], for example AGAR[4], PicoGUI[5] and Guichan[6]. Most of them are written in C++ and some in C and as far as I know none of them have bindings for Python nor Ruby. Then using SDL you can only have one top-level window which means your application (or the GUI toolkit you use) have to do its own window managing for various dialogs and such. But I guess that was what you intended anyway.
[1] cairographics.org/
[2] library.gnome.org/devel/gdk/unstable/index.html
[3] www.libsdl.org/
[4] libagar.org/
[5] picogui.org/
[6] guichan.sourceforge.net/wiki/index.php/Main_Page
You'll probably want something like pygame then.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With