Python-Tkinter issue. Multiple overlaping event routines called by single click

Steven D'Aprano steve+comp.lang.python at pearwood.info
Sat Aug 11 21:12:41 EDT 2018


On Sun, 12 Aug 2018 01:30:43 +0100, MRAB wrote:

> On 2018-08-11 21:01, wfgazdzik at gmail.com wrote:
>> I have a main window open.  Then I open a tk.TopLevel dialog window
>> giving the user multiple choices.  He selects one, the corresponding
>> event is executed.  Then in the underlining main window, just by chance
>> there is another button exactly under the mouse click in the TopLevel
>> dialog window.  Its corresponding event is then triggered.
>> 
>> How can I keep the main window button that just happens to be in the
>> wrong place from being triggered?
>> 
> The handler should return the string "break" to prevent the event from
> propagating further. Are you doing that? It's surprising how far you can
> go without it before running into a problem!

I think you are mistaken:

https://stackoverflow.com/a/12357536

but since the description of the problem is so vague, it is hard to tell 
exactly what's happening.


-- 
Steven D'Aprano
"Ever since I learned about confirmation bias, I've been seeing
it everywhere." -- Jon Ronson




More information about the Python-list mailing list