MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _create_application

Function _create_application

lib/matplotlib/backends/_backend_gtk.py:45–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

43
44
45def _create_application():
46 global _application
47
48 if _application is None:
49 app = Gio.Application.get_default()
50 if app is None or getattr(app, '_created_by_matplotlib', False):
51 # display_is_valid returns False only if on Linux and neither X11
52 # nor Wayland display can be opened.
53 if not mpl._c_internal_utils.display_is_valid():
54 raise RuntimeError('Invalid DISPLAY variable')
55 _application = Gtk.Application.new('org.matplotlib.Matplotlib3',
56 Gio.ApplicationFlags.NON_UNIQUE)
57 # The activate signal must be connected, but we don't care for
58 # handling it, since we don't do any remote processing.
59 _application.connect('activate', lambda *args, **kwargs: None)
60 _application.connect('shutdown', _shutdown_application)
61 _application.register()
62 cbook._setup_new_guiapp()
63 else:
64 _application = app
65
66 return _application
67
68
69def mpl_to_gtk_cursor_name(mpl_cursor):

Callers 1

__init__Method · 0.85

Calls 2

connectMethod · 0.45
registerMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…