The Canvas Clock example demonstrates the built-in canvas widget which directly utilizes the Cairo 2D graphics library (Cairo, not Claro) for vector graphics. Claro's canvas is compiled with Cairo support by default, and provides a cairo_t context ready for use to the redraw event handler.
Screenshots
![]() |
|
![]() |
| GTK on Linux |
Cocoa on Mac OS X |
Win32 API on WinXP |
Tech Specs
This example primarily demonstrates the canvas widget, but it is also a simple example of using Layout Expression Language (LEL). The canvas and 3 button widgets are all positioned/sized using a simple lelex string, and they therefore dynamically size correctly as the window is resized.
Source Code
You can find the source code for the canvas test in the Claro SVN repository:
https://dev.sitehole.com/svn/claro/trunk/examples/canvas/canvas-test.c
A partial example of this same application written using the Claro wrapper for D is also available:
https://dev.sitehole.com/svn/claro/trunk/interface/d/test1.d

