Perhaps you should try this:

import sys
import gi 
from gi.repository import Clutter
Clutter.init(sys.argv) 

label = Clutter.Text()
label.set_text("Clutter Test")
label.set_position(0, 100)

color = Clutter.Color()
color.from_string("Red")
stage = Clutter.Stage.get_default()
stage.set_color(color)
stage.add_actor(label)
stage.show_all()
Clutter.main()

that should work. You need to initialize the stage and of course you
need to run the Clutter.main() loop.

best 

tomw


On Di, 2011-08-09 at 01:48 +0200, Dennis Schulmeister wrote:
> Hello,
> 
> Now that I'm subscribed to this list for more than two years I'm finally
> ready to try it out myself. Since I'm already very comfortable with
> python and (the now somewhat obsolete) pygtk either python-clutter or
> cluttermm would be a more natural fit for me instead of the C API.
> Searching around the net I also came up pretty decent documentation.
> Somehow neither one wants to run on Debian though, so I'd be grateful
> for any insights where the problem might be.
> 
> Debian testing currently has python-clutter 1.3.2.2+b1 which seems
> rather current. I suspect this will go away anytime soon in favor of
> pygobject? Unfortunately the following example segfaults:
> 
> >>> import clutter
> >>> 
> >>> label = clutter.Text()
> >>> label.set_text("Clutter Test")
> >>> label.set_position(0, 100)
> >>> 
> >>> stage = clutter.Stage()
> >>> stage.set_color(clutter.color_from_string("Red"))
> >>> stage.add(label)
> >>> stage.show_all()
> 
> The same goes for a pygobject based version of the example:
> 
> >>> import sys
> >>> from gi.repository import Clutter
> >>> Clutter.init(sys.argv) 
> >>>
> >>> label = Clutter.Text()
> >>> label.set_text("Clutter Test")
> >>> label.set_position(0, 100)
> >>>
> >>> color = Clutter.Color()
> >>> color.from_string("Red")
> >>>
> >>> stage = Clutter.Stage()
> >>> stage.set_color(color)
> >>> stage.add_actor(label)
> >>> stage.show_all()
> 
> Despite the statement from the reference manual cluttermm doesn't seem
> to be in Debian at all, at the moment. No big deal, I simply installed
> it from source (with prefix /usr/local). Compiling a minimal example
> works but the application won't run as it doesn't find the library:
> 
> $ c++ -Wall -g `pkg-config --cflags --libs cluttermm-1.0`
>   -o test test.cpp
> $ ./test
> ./test: error while loading shared libraries: libcluttermm-1.0.so.1:
> cannot open shared object file: No such file or directory
> $ ls /usr/local/lib/libcluttermm-1.0.so.1
> /usr/local/lib/libcluttermm-1.0.so.1
> 
> Right now I'm stuck. Any input would be much appreciated.
> 
> 
> Yours sincerely,
> Dennis Schulmeister
> 

-- 
tomw <[email protected]>

_______________________________________________
clutter-app-devel-list mailing list
[email protected]
http://lists.clutter-project.org/listinfo/clutter-app-devel-list

Reply via email to