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

Method toolmanager_connect

lib/matplotlib/backend_managers.py:98–126  ·  view source on GitHub ↗

Connect event with string *s* to *func*. Parameters ---------- s : str The name of the event. The following events are recognized: - 'tool_message_event' - 'tool_removed_event' - 'tool_added_event' For ev

(self, s, func)

Source from the content-addressed store, hash-verified

96 tool.figure = figure
97
98 def toolmanager_connect(self, s, func):
99 """
100 Connect event with string *s* to *func*.
101
102 Parameters
103 ----------
104 s : str
105 The name of the event. The following events are recognized:
106
107 - 'tool_message_event'
108 - 'tool_removed_event'
109 - 'tool_added_event'
110
111 For every tool added a new event is created
112
113 - 'tool_trigger_TOOLNAME', where TOOLNAME is the id of the tool.
114
115 func : callable
116 Callback function for the toolmanager event with signature::
117
118 def func(event: ToolEvent) -> Any
119
120 Returns
121 -------
122 cid
123 The callback id for the connection. This can be used in
124 `.toolmanager_disconnect`.
125 """
126 return self._callbacks.connect(s, func)
127
128 def toolmanager_disconnect(self, cid):
129 """

Callers 4

__init__Method · 0.80
_add_tool_cbkMethod · 0.80
__init__Method · 0.80
add_toolMethod · 0.80

Calls 1

connectMethod · 0.45

Tested by

no test coverage detected