Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

can't stop macosx mainloop #10002

Copy link
Copy link
Closed
@minrk

Description

@minrk
Issue body actions

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.