Hi,
Can someone give me a hint on what I'm doing wrong with the following code?
I just want to paint something with cairo on an clutter actor. But I only
get a blue stage with nothing on it.
I tried to compare the steps with with the flowers and clock example ( in C)
but I did not see anything obvious.
Cheers,
Stefan
#!/usr/bin/env python
import clutter
import cairo
from clutter import cluttercairo
stage = clutter.stage_get_default()
stage.set_size(500, 500)
stage.set_color(clutter.color_parse('Dark Blue'))
stage.connect('key-press-event', clutter.main_quit)
cTexture = cluttercairo.CairoTexture(300,300)
cTexture.set_position(50, 50)
cContext = cTexture.cairo_create()
cContext.set_operator(cairo.OPERATOR_OVER)
cContext.set_line_width(5)
cContext.set_source_rgba(0, 1, 0, 0.5)
cContext.move_to(100, 100)
cContext.rel_line_to(100, 100)
cContext.rel_line_to(-200, 0)
cContext.close_path()
cContext.stroke()
cTexture.show()
stage.add(cTexture)
stage.show_all()
clutter.main()