from gi.repository import Gtk

class InternalWidget(Gtk.Button):
    def __init__(self):
        super(InternalWidget, self).__init__()
        self.set_size_request(100,100)
        self.connect("button-press-event", self.on_press)

    def on_press(self, *args):
        print "The Internal Widget was clicked."


class ExternalEventBox(Gtk.EventBox):
    def __init__(self):
        super(ExternalEventBox, self).__init__()
        self.fixed = Gtk.Fixed()
        self.add(self.fixed)
        self.internal_widget = InternalWidget()
        self.set_size_request(200, 200)
        self.connect("button-press-event", self.on_press)
        self.connect("enter-notify-event", self.on_enter)
        self.connect("leave-notify-event", self.on_leave)

    def on_enter(self, *args):
        self.fixed.put(self.internal_widget, 50,50)
        self.show_all()

    def on_leave(self, *args):
        self.fixed.remove(self.internal_widget)

    def on_press(self,*args):
        print "The External Event Box was clicked."

w = Gtk.Window(Gtk.WindowType.TOPLEVEL)
w.connect("delete-event", Gtk.main_quit)
w.add(ExternalEventBox())
w.show_all()
Gtk.main()
