Ignoring GUI events

Hello,

How do I prevent a canvas shown as part of a GUI from responding to any mouse clicks?
Using SetEditable to false disables the main (“left”) button click.
But how do I block all mouse clicks, or at least, all possible edits of the display.

This is a continuation of the PyROOT support thread Ignoring events, preferably with TPyDispatcher following Dominique’s observation that it has nothing to do with PyROOT and should be solved within standard ROOT GUI. So please pardon my PyROOT-centric description. I never used ROOT’s GUI tools from C++.

Does anyone know how to ignore Tkinter events in a GUI (or a specific window or canvas) through python?
I’m trying to block the default (class-level, I guess) binding of a ROOT object displayed in a GUI. I found effbot.org/tkinterbook/tkinter-e … ndings.htm which explains that the event handler needs to return the string “break” to do so. But this does not work for me when my event handler is called via TPyDispatcher. Looking at TPyDispatcher, it does return a generic PyObject* from its fCallable, so this doesn’t look hopeless.

A minimal application demonstrating the “problem” is attached.
The goal is to prevent, e.g., movement of the TGaxis drawn in the canvas using the mouse buttons, the opening of the menu by a right click, etc.

thanks,
Amnon
test_gui2.py (1.42 KB)