8000 Pressing "enter" or "numpad enter" within a TextBox has no effect when using the WxAgg backend · Issue #15328 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Pressing "enter" or "numpad enter" within a TextBox has no effect when using the WxAgg backend #15328

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
MartyMacGyver opened this issue Sep 23, 2019 · 3 comments

Comments

@MartyMacGyver
Copy link

Bug report

Bug summary

Pressing "enter" or "numpad enter" within a TextBox has no effect when using the WxAgg backend

Code for reproduction

# Based on https://matplotlib.org/3.1.1/gallery/widgets/textbox.html

import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets import TextBox
import matplotlib as mpl

#mpl.use('TkAgg')  # Enter and numpad enter work fine
#mpl.use('Qt5Agg')  # Enter and numpad enter work fine
mpl.use('WxAgg')  # Neither enter nor numpad enter work

fig, ax = plt.subplots()
plt.subplots_adjust(bottom=0.2)
t = np.arange(-2.0, 2.0, 0.001)
s = t ** 2
initial_text = "t ** 2"
l, = plt.plot(t, s, lw=2)

def submit(text):
    print(text)
    plt.draw()

axbox = plt.axes([0.1, 0.05, 0.8, 0.075])
text_box = TextBox(axbox, 'Evaluate', initial=initial_text)
text_box.on_submit(submit)

plt.show()

Actual outcome

With the TkAgg and Qt5Agg backends, pressing "enter" or "numpad enter" within a TextBox work as expected (you see the printed value of the box text in the console).

With the WxAgg backend you can enter/delete characters but the enter keys have no effect.

Expected outcome

The enter keys should work equally well in all of these backends.

Note: Clicking into and then out of the TextBox still works regardless of the backend chosen

Matplotlib version

  • Operating system: Windows 10
  • Matplotlib version: 3.1.1
  • Matplotlib backend (print(matplotlib.get_backend())): See above - problem is with WxAgg
  • Python version: 3.7.4
  • Jupyter version (if applicable): n/a
  • Other libraries: WxPython 4.0.6

Installed via pip.

@anntzer
Copy link
Contributor
anntzer commented Sep 23, 2019

possibly related to #15177?

@anntzer
Copy link
Contributor
anntzer commented Sep 25, 2019

Indeed, this is a duplicate of #8249 and likewise fixed by #15177. Thanks for the report :)

@anntzer anntzer closed this as completed Sep 25, 2019
@MartyMacGyver
Copy link
Author

Interesting. This appears to be a pretty old bug then..

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

No branches or pull requests

2 participants
0