Message266014
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()'. |
|
Date |
User |
Action |
Args |
2016-05-21 18:56:50 | terry.reedy | set | recipients:
+ terry.reedy, upendra-k14, lorenzogotuned |
2016-05-21 18:56:50 | terry.reedy | set | messageid: <1463857010.39.0.432219619412.issue27051@psf.upfronthosting.co.za> |
2016-05-21 18:56:50 | terry.reedy | link | issue27051 messages |
2016-05-21 18:56:50 | terry.reedy | create | |
|