public
Created

GtkClutter PyGobject

  • Download Gist
gistfile1.py
Python
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
from gi.repository import Gtk, Clutter, GtkClutter
 
def pressed(w, e):
print w, e
 
GtkClutter.init([])
 
window = Gtk.Window.new(Gtk.WindowType.TOPLEVEL)
vbox = Gtk.VBox.new(False, 6)
window.add(vbox)
vbox.show()
button = Gtk.Button("New BUtton")
vbox.pack_end(button, False, False, 0)
button.show()
 
window.connect("hide", Gtk.main_quit)
 
embed = GtkClutter.Embed.new()
vbox.pack_start(embed, True, True, 0)
embed.show()
 
embed.set_size_request(200, 200)
 
stage = embed.get_stage()
stage.set_color(Clutter.Color.new(0x00,0x00,0x00,0xff))
 
stage.show()
 
stage.connect("button-press-event", pressed)
 
window.show()
 
Gtk.main()

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.