Enable event loop integration with MacOSX. We call function pyplot.pause, which updates and displays active figure during pause. It's not MacOSX-specific, but it enables to avoid inputhooks in native MacOSX backend. Also we shouldn't import pyplot, until user does it
(self, app=None)
| 448 | self.clear_inputhook() |
| 449 | |
| 450 | def enable_mac(self, app=None): |
| 451 | """Enable event loop integration with MacOSX. |
| 452 | |
| 453 | We call function pyplot.pause, which updates and displays active |
| 454 | figure during pause. It's not MacOSX-specific, but it enables to |
| 455 | avoid inputhooks in native MacOSX backend. |
| 456 | Also we shouldn't import pyplot, until user does it. Cause it's |
| 457 | possible to choose backend before importing pyplot for the first |
| 458 | time only. |
| 459 | """ |
| 460 | |
| 461 | def inputhook_mac(app=None): |
| 462 | if self.pyplot_imported: |
| 463 | pyplot = sys.modules["matplotlib.pyplot"] |
| 464 | try: |
| 465 | pyplot.pause(0.01) |
| 466 | except: |
| 467 | pass |
| 468 | else: |
| 469 | if "matplotlib.pyplot" in sys.modules: |
| 470 | self.pyplot_imported = True |
| 471 | |
| 472 | self.set_inputhook(inputhook_mac) |
| 473 | self._current_gui = GUI_OSX |
| 474 | |
| 475 | def disable_mac(self): |
| 476 | self.clear_inputhook() |
nothing calls this directly
no test coverage detected