This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients lorenzogotuned, terry.reedy, upendra-k14
Date 2016-05-21.18:56:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1463857010.39.0.432219619412.issue27051@psf.upfronthosting.co.za>
In-reply-to
Content
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()'.
History
Date User Action Args
2016-05-21 18:56:50terry.reedysetrecipients: + terry.reedy, upendra-k14, lorenzogotuned
2016-05-21 18:56:50terry.reedysetmessageid: <1463857010.39.0.432219619412.issue27051@psf.upfronthosting.co.za>
2016-05-21 18:56:50terry.reedylinkissue27051 messages
2016-05-21 18:56:50terry.reedycreate