#!/usr/bin/python2
from gi.repository import GtkClutter
GtkClutter.init([])

from gi.repository import Clutter
from gi.repository import Gtk
Clutter.init([])

win = Gtk.Window()
embed = GtkClutter.Embed()
actor = Clutter.Actor()

actor.set_reactive(True)
actor.set_background_color(Clutter.Color.from_string("#FF0000")[1])
actor.set_size(400, 400)

embed.get_stage().add_child(actor)
win.add(embed)
win.show_all()


def releaseCb(widget, event, s):
    print s, widget

embed.connect("button-press-event", releaseCb, "embed-press")
actor.connect("button-press-event", releaseCb, "actor-press")

embed.connect("button-release-event", releaseCb, "embed-release")
actor.connect("button-release-event", releaseCb, "actor-release")

win.connect("delete-event", Gtk.main_quit)
Gtk.main()

