Terry J. Reedy added the comment:

I posted notice of this issue on #23551.

I did some research on simulating user interaction for testing.  The results 
are exemplified in the attached tk.generate_event.py with test setups and 
assertions.

Events are generated, to fire event handlers, with
  widget.generate_event(event, **kwds)
where keywords are used to set event attributes.  The uploaded file has 
examples.  The method is briefly described in
  http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/universal.html
This reference has a more extensive coverage of events in a separate chapter.

The above does not mention the need to update the widget first.  I learned this 
from Stackoverflow answers to 'How to make generate_event work?" questions.  
The tcl/tk doc, tcl.tk/man/tcl8.6/TkCmd/event.htm, adds the fact that text 
widgets require focus.

Even though button commands fire when releasing the 'main' button, event 
'<ButtonRelease-1>' does not work to fire commands.  Instead, use 
'button.invoke()'.

----------
stage:  -> test needed
versions: +Python 3.6
Added file: http://bugs.python.org/file42930/tk_generate_event.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27051>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to