New submission from Guilherme Polo <[EMAIL PROTECTED]>:

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()

----------
components: Tkinter
files: event_generate__data.diff
keywords: patch
messages: 69951
nosy: gpolo
severity: normal
status: open
title: Add support for the new data option supported by event generate (Tk 8.5)
versions: Python 2.6, Python 3.0
Added file: http://bugs.python.org/file10934/event_generate__data.diff

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3405>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to