Skip to content

can't stop macosx mainloop #10002

@minrk

Description

@minrk

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

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy