Follows a patch that adds support for the new data option supported
event generate. It allows virtual events to pass a tcl object.
This patch is only intended to correctly support tcl objects, trying to
pass other objects (like a dict) will result in None being returned. If
you want to correctly pass and receive a dict, make it an attribute of
the tcl object being passed.
E.g.:
import Tkinter
def handle_it(event):
print event.data.something
root = Tkinter.Tk()
root.something = {1: 2}
root.after(1, lambda: root.event_generate('<<Test>>', data=root))
root.bind('<<Test>>', handle_it)
root.mainloop()