New submission from Serhiy Storchaka:
Proposed patch adds better repr for tkinter.Event objects. Currently default
repr shows only class name (always the same) and object address (not
interesting, since event objects are short-living). The patch makes repr
showing most event attributes in human-readable form.
For testing run following script. Press any keys (with modifiers), move and
click mouse, select text, move and resize the window, switch to other windows.
import tkinter
t = tkinter.Text()
t.pack()
t.bind("<<Selection>>", print)
t.bind("<<debug>>", print)
for k in tkinter.EventType:
try:
t.event_add("<<debug>>", '<%s>' % k)
except tkinter.TclError:
pass
tkinter.mainloop()
----------
components: Tkinter
messages: 268209
nosy: serhiy.storchaka, terry.reedy
priority: normal
severity: normal
stage: patch review
status: open
title: Better repr for Tkinter event objects
type: enhancement
versions: Python 3.6
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue27294>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com