[New-bugs-announce] [issue3405] Add support for the new data option supported by event generate (Tk 8.5)

Guilherme Polo report at bugs.python.org
Fri Jul 18 14:52:46 CEST 2008


New submission from Guilherme Polo <ggpolo at gmail.com>:

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 <report at bugs.python.org>
<http://bugs.python.org/issue3405>
_______________________________________


More information about the New-bugs-announce mailing list