Documentation on button-press-event says:
To receive this signal, the GdkWindow associated to the widget needs to enable the GDK_BUTTON_PRESS_MASK mask.
So import Gdk as well and then do
win.set_events (Gdk.EventMask.BUTTON_PRESS_MASK)
That should make your example work.
In the text you also mention a frame. If you plan on doing the same thing with a GtkFrame note that only widgets with their own window can receive events, and containers like Frame typically do not have a window. You may have to put the frame inside a EventBox that can receive the events.