Ejemplo n.º 1
0
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):
    print("hello world")


button = gtk.Button("Click me")
button.connect("clicked", sayhi)
# vbox.pack_end(button, False, False, 0)
gact = clutter.gtk_clutter_actor_new_with_contents(button)
# gact.set_size(100, 100)
gact.set_anchor_point(50, 50)
gact.set_position(150, 150)
gact.set_rotation(clutter.CLUTTER_Z_AXIS, 80.0, 0, 0, 0)
button.show()
clutter.container_add_actor(stage, gact)


button = gtk.Button("gtk-ok")
button.set_use_stock(True)
vbox.pack_end(button, False, False, 0)
button.show()

window.show_all()
while True:
Ejemplo n.º 2
0
#window.connect('destroy', gtk.main_quit)
vbox = gtk.VBox(False, 6)
window.add(vbox)

embed = clutter.gtk_clutter_embed_new()  # gtk-widget type
embed.set_size_request(300, 300)

sw = gtk.ScrolledWindow()
sw.set_size_request(180, 420)
sw.add_with_viewport(embed)
sw.set_policy(True, False)
vbox.pack_start(sw, True, True, 0)

## its ok to create actors before the stage is realized ##
box = gtk.VBox()
ACTOR = clutter.gtk_clutter_actor_new_with_contents(box)
ACTOR.set_scale(0.75, 1.0)

# we need to realize the widget before we get the stage #
'''
/**
 * SECTION:gtk-clutter-embed
 * @short_description: Widget for embedding a Clutter scene
 *
 * #GtkClutterEmbed is a GTK+ widget embedding a #ClutterStage. Using
 * a #GtkClutterEmbed widget is possible to build, show and interact with
 * a scene built using Clutter inside a GTK+ application.
 *
 * <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
Ejemplo n.º 3
0
#window.connect('destroy', gtk.main_quit)
vbox = gtk.VBox(False, 6)
window.add(vbox)

embed = clutter.gtk_clutter_embed_new()	# gtk-widget type
embed.set_size_request(300, 300)

sw = gtk.ScrolledWindow()
sw.set_size_request( 180, 420 )
sw.add_with_viewport( embed )
sw.set_policy(True,False)
vbox.pack_start(sw, True, True, 0)

## its ok to create actors before the stage is realized ##
box = gtk.VBox()
ACTOR = clutter.gtk_clutter_actor_new_with_contents( box )
ACTOR.set_scale( 0.75, 1.0 )

# we need to realize the widget before we get the stage #
'''
/**
 * SECTION:gtk-clutter-embed
 * @short_description: Widget for embedding a Clutter scene
 *
 * #GtkClutterEmbed is a GTK+ widget embedding a #ClutterStage. Using
 * a #GtkClutterEmbed widget is possible to build, show and interact with
 * a scene built using Clutter inside a GTK+ application.
 *
 * <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
Ejemplo n.º 4
0
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):
    print('hello world')


button = gtk.Button('Click me')
button.connect('clicked', sayhi)
#vbox.pack_end(button, False, False, 0)
gact = clutter.gtk_clutter_actor_new_with_contents(button)
#gact.set_size(100, 100)
gact.set_anchor_point(50, 50)
gact.set_position(150, 150)
gact.set_rotation(clutter.CLUTTER_Z_AXIS, 80.0, 0, 0, 0)
button.show()
clutter.container_add_actor(stage, gact)

button = gtk.Button('gtk-ok')
button.set_use_stock(True)
vbox.pack_end(button, False, False, 0)
button.show()

window.show_all()
while True:
    if gtk.gtk_events_pending():