class_docstr: Manager for actions triggered by user interactions (key press, toolbar
  clicks, ...) on a Figure.
  
  Attributes
  ----------
  figure : `.Figure`
  keypresslock : `~matplotlib.widgets.LockDraw`
      `.LockDraw` object to know if the `canvas` key_press_event is locked.
  messagelock : `~matplotlib.widgets.LockDraw`
      `.LockDraw` object to know if the message is available to write.
class_docstr_tok: ["Manager","for","actions","triggered","by","user","interactions","(","key","press",",","toolbar","clicks",",","...",")","on","a","Figure",".","Attributes","--","--","--","--","--","figure",":","`",".Figure","`","keypresslock",":","`","~matplotlib.widgets.LockDraw","`","`",".LockDraw","`","object","to","know","if","the","`","canvas","`","key_press_event","is","locked",".","messagelock",":","`","~matplotlib.widgets.LockDraw","`","`",".LockDraw","`","object","to","know","if","the","message","is","available","to","write","."]
docstr: 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 every tool added a new event is created
  
      - 'tool_trigger_TOOLNAME', where TOOLNAME is the id of the tool.
  
  func : callable
      Callback function for the toolmanager event with signature::
  
          def func(event: ToolEvent) -> Any
  
  Returns
  -------
  cid
      The callback id for the connection. This can be used in
      `.toolmanager_disconnect`.
docstr_tok: ["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","every","tool","added","a","new","event","is","created","-","'tool_trigger_TOOLNAME","'",",","where","TOOLNAME","is","the","id","of","the","tool",".","func",":","callable","Callback","function","for","the","toolmanager","event","with","signature",":",":","def","func","(","event",":","ToolEvent",")","-",">","Any","Returns","--","--","--","-","cid","The","callback","id","for","the","connection",".","This","can","be","used","in","`",".toolmanager_disconnect","`","."]
code: def toolmanager_connect(self, s, func):
      """
      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 every tool added a new event is created
  
          - 'tool_trigger_TOOLNAME', where TOOLNAME is the id of the tool.
  
      func : callable
          Callback function for the toolmanager event with signature::
  
              def func(event: ToolEvent) -> Any
  
      Returns
      -------
      cid
          The callback id for the connection. This can be used in
          `.toolmanager_disconnect`.
      """
      return self._callbacks.connect(s, func)
  
imports: from matplotlib import _api, backend_tools, cbook, widgets
label_desc: Use image node_id 6 for calling the ToolManager obj's underlying member method code with example usage: obj.toolmanager_connect(s, func) and returns: self