Closed
Description
Bug report
Bug summary
I can't figure out how to stop the cocoa mainloop once it's going with the macosx backend. This could be a missing API, or just one that I don't know about.
I suspect an API that exposes sending [NSApp stop]
is all that's needed, but I'm not sure.
Code for reproduction
import matplotlib
matplotlib.use('macosx')
import matplotlib.pyplot as plt
from matplotlib.backends.backend_macosx import TimerMac, show
def stop_mainloop():
print("I don't know how to quit you")
t.stop()
t = TimerMac(2000)
t.add_callback(stop_mainloop)
t.start()
show.mainloop()
Actual outcome
Loop runs forever because I don't know how to stop it.
Matplotlib version
- Operating system: macOS 10.13.2
- Matplotlib version: 2.0.2 (conda-forge)
- Matplotlib backend (
print(matplotlib.get_backend())
): MacOSX - Python version: 3.6.1