# we need to realize the widget before we get the stage embed.realize() print("embed realized") stage = clutter.gtk_clutter_embed_get_stage(embed) # embed.get_stage() clr = clutter.color_new(0, 0, 127, 100) clutter.clutter_stage_set_color(stage, clr) rect = clutter.rectangle_new() # clutter.Rectangle() clr = clutter.color_new(100, 1, 0, 100) clutter.rectangle_set_color(rect, clr) # rect.set_color( clr ) rect.set_size(100, 100) rect.set_anchor_point(50, 50) rect.set_position(150, 150) rect.set_rotation(clutter.CLUTTER_X_AXIS, 45.0, 0, 0, 0) clutter.container_add_actor(stage, rect) tex = clutter.texture_new_from_file("/usr/share/pixmaps/splash/gnome-splash.png", None) # clutter.clutter_texture_set_from_file(tex,'/usr/share/pixmaps/splash/gnome-splash.png') tex.set_size(100, 100) tex.set_anchor_point(50, 50) tex.set_position(150, 150) tex.set_rotation(clutter.CLUTTER_Z_AXIS, 60.0, 0, 0, 0) clutter.container_add_actor(stage, tex) # update the position of the actors when the stage changes # size due to an allocation # stage.connect('notify::allocation', on_stage_allocate, rect, tex) def sayhi(b):
* <note>To avoid flickering on show, you should call gtk_widget_show() * or gtk_widget_realize() before calling clutter_actor_show() on the * embedded #ClutterStage actor. This is needed for Clutter to be able * to paint on the #GtkClutterEmbed widget.</note> * * Since: 0.6 */ ''' embed.realize() print('embed realized') stage = clutter.gtk_clutter_embed_get_stage(embed) clr = clutter.color_new(0, 0, 127, 10) clutter.stage_set_color(stage, clr) clutter.actor_show(stage) clutter.container_add_actor(stage, ACTOR) def sayhi(b, actor): print('hello world', actor) if actor.get_scale()[0] < 1.0: scale = 1.5 else: scale = 0.75 actor.animate( clutter.CLUTTER_LINEAR, 500, scale_x=scale, ) for i in range(10): ex = gtk.Expander('expand me')
* <note>To avoid flickering on show, you should call gtk_widget_show() * or gtk_widget_realize() before calling clutter_actor_show() on the * embedded #ClutterStage actor. This is needed for Clutter to be able * to paint on the #GtkClutterEmbed widget.</note> * * Since: 0.6 */ ''' embed.realize() print('embed realized') stage = clutter.gtk_clutter_embed_get_stage( embed ) clr = clutter.color_new( 0,0,127,10 ) clutter.stage_set_color(stage, clr) clutter.actor_show( stage ) clutter.container_add_actor( stage, ACTOR ) def sayhi(b, actor): print('hello world', actor) if actor.get_scale()[0] < 1.0: scale = 1.5 else: scale = 0.75 actor.animate( clutter.CLUTTER_LINEAR, 500, scale_x=scale, ) for i in range(10): ex = gtk.Expander('expand me') box.pack_start( ex ) button = gtk.Button('Click me') button.connect('clicked', sayhi, ACTOR)
# we need to realize the widget before we get the stage embed.realize() print('embed realized') stage = clutter.gtk_clutter_embed_get_stage(embed) #embed.get_stage() clr = clutter.color_new(0, 0, 127, 100) clutter.clutter_stage_set_color(stage, clr) rect = clutter.rectangle_new() #clutter.Rectangle() clr = clutter.color_new(100, 1, 0, 100) clutter.rectangle_set_color(rect, clr) #rect.set_color( clr ) rect.set_size(100, 100) rect.set_anchor_point(50, 50) rect.set_position(150, 150) rect.set_rotation(clutter.CLUTTER_X_AXIS, 45.0, 0, 0, 0) clutter.container_add_actor(stage, rect) tex = clutter.texture_new_from_file( '/usr/share/pixmaps/splash/gnome-splash.png', None) #clutter.clutter_texture_set_from_file(tex,'/usr/share/pixmaps/splash/gnome-splash.png') tex.set_size(100, 100) tex.set_anchor_point(50, 50) tex.set_position(150, 150) tex.set_rotation(clutter.CLUTTER_Z_AXIS, 60.0, 0, 0, 0) clutter.container_add_actor(stage, tex) # update the position of the actors when the stage changes # size due to an allocation #stage.connect('notify::allocation', on_stage_allocate, rect, tex)