TouchWidgets is my new widget library that is animation- and touch-friendly.
TouchWidgets as a C++ project, in part because I based it
partly on some of my previous C++ and C projects,
but as of 0.28,
TouchWidgets is an Objective C library. What that means is, I've
painstakingly converted my C++ code to ObjC.
It still sits on top of X Windows but eventually that too will change
and I will go with OpenGL.
TouchWidgets uses the Model-View-Controller paradigm, where the
model is your data, the views are representations of your data and containers of data,
and the controllers are code that manages views. Response to inputs is handled
by both views and controllers.
The class hierarchy is as follows, using namespace TouchWidgets:
| +---- UXLabel, UXButton, UXImageView, UXGraph etc.
| +---- UXContainer
| +---- UXGrid
| +---- UXScroll
| +---- UXVerticalList
(I will probably change the UX prefix.)
Adding styles to widgets can be done programmatically
or it can be done using an external style file. This second method
is loosely based the idea of CSS but is far more rudimentary.
A view or container object can take styles of four levels:
- All instances
- Class e.g. ImageView
- Style class name e.g. screen2labels
- Instance name e.g. label3
Screenshots from the C++ code
Tap to embiggen:
If you're going to run TouchWidgets on a Mac, you'll need to install XQuartz.
the header files in
The Makefile is currently written for both GNU/Linux and OS/X.
Eventually I will add an auto-configuration script.