Open fred4ets opened 3 years ago
Hello,
Anybody has any clue to fix this issue?
Thanks in advance.
Regards
Sorry for the long delay in looking at this. It looks like there are a couple of things going on here.
It looks like part of the problem is the way that key events are handled. If you run the sample code, you will see that the FooTool
actually works when the mouse pointer is in the padding region outside the plot area. This is because what is happening is that:
Interactor
, if there is a matching handler eg. normal_key_pressed
then it gets called; and if the auto_handle_event
trait is True then the key event gets marked as "handled" even if the tool does nothing.The LassoSelection/RectangleSelection tools on the renderers have key interactions, so they will go through that codepath, which means the key event never gets to the FooTool on the Plot
object.
Probably the easiest work-around this is to put the FooTool
on the renderer but before the RectangleSelection
in the list of tools, so it gets the event first.
There may be some thought needed about the LassoSelection
tool and whether it should be auto-handling events. Some of the issue may be because LassoSelection
doesn't inherit from BaseTool
, which doesn't have the auto-handling behaviour.
I'm not 100% sure what the issue is with the selection turning off. I only see this when you click (which the selection tool likely things of as the start of a new selection, and so deselecting things makes sense). The selection tools do have optional selection modes that extent or invert selections, so it may be that one of those makes more sense to use?
Hello,
I have 2 issues using RectangularSelection.
See CME below showing the 2 issues.
CME is based on chaco/examples/demo/basic/scatter_rect_select.py.
I have added FooTool class, which displays "Foo!" when key "p" is pressed.
And added enable_rect_selection trait to enable/disable RectangularSelection.
First, if you set enable_rect_selection to False, you get:
Now, if you set enable_rect_selection to True, you get:
So, what I would like to have as behaviour, when enable_rect_selection is set to True, is:
How could I achieve this?
Thanks in advance.
Regards.
The CME:
Debian x86_64, Python 3.7.3, ETS source from git