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)
| 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 | """ |
no test coverage detected