8000 Update blocking_input.py by saksmito · Pull Request #11661 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Update blocking_input.py #11661

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Update blocking_input.py #11661

wants to merge 2 commits into from

Conversation

saksmito
Copy link
Contributor

ginput doesn´t allow to disable buttons.
With this change you can assign an invalid button to the three mouse buttons and leave the left click empty to zoom or pan.

Only one issue. I´m just starting with python (only worked with matlab and VB, you can tell my proficiency by that alone, so please don´t be too harsh if I made any mistake) and I don´t know if this change in BlockingMouseInput will create a regression issue to any other matplotlib function.

Thanks.

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

saksmito added 2 commits July 15, 2018 10:03
ginput doesn´t allow to disable buttons.
With this change you can assign an invalid button to the three mouse buttons and leave the left click empty to zoom or pan.

Only one issue. I´m just starting with python (only worked with matlab and VB, you can tell my proficiency by that alone, so please don´t be too harsh if I made any mistake) and I don´t know if this change in BlockingMouseInput will create a regression issue to any other matplotlib function.

Thanks.
Updated the documentation associated with ginput, regarding the changes applied to blocking_input to allow for pan and zoom
@@ -135,7 +135,7 @@ def mouse_event(self):
self.mouse_event_pop(event)
elif button == self.button_stop:
self.mouse_event_stop(event)
else:
elif self.button_add:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be elif button == self.button_add:?

Or am I overlooking something and there is actually an asymmetry that there are other buttons that should be implicitly be handled as add event if button_add is defined?

@@ -2139,10 +2139,13 @@ def ginput(self, n=1, timeout=30, show_clicks=True, mouse_add=1,
If True, show a red cross at the location of each click.
mouse_add : int, one of (1, 2, 3), optional, default: 1 (left click)
Mouse button used to add points.
Use a different button value to disable this mouse action.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably we should use None to disable an action.

@saksmito
Copy link
Contributor Author
saksmito commented Jul 15, 2018 via email

@jklymak jklymak added this to the v3.1 milestone Jul 17, 2018
@dopplershift
Copy link
Contributor

Superseded by #12199 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0