So last week, I started writing a maemo fremantle widget in a few spare pockets of time. One thing got me stuck. I could not get the thing to be transparent. I tried looking at other widgets’ code but just couldn’t figure it out. Finally at the Extending Hildon Desktop BoF yesterday at the Maemo Summit, I got my answer: set the colormap of the window to be 32bit rgba.
Here is the code needed in the __init__ in a python widget:
colormap = self.get_screen().get_rgba_colormap() self.set_colormap (colormap)
In the expose event handler, you have to clear with the cairo context (which I had figured out last week) with code like:
cr = self.window.cairo_create() cr.set_source_rgba (1.0, 1.0, 1.0, 0.0) cr.set_operator(cairo.OPERATOR_SOURCE) cr.paint()
My flickr fremantle tag photoset shows the progression and what runs now is:
There is still a little work to do, like respecting theme colours and more accurate positioning of hour etc before I create a package to push into extras.