code: def add_tools(self):
          
  
          for data in self.toolbardata:
              # tool type is in data[0]
  
              if data[0] == "T":
                  # Simple tool
  
                  _, msg_type, label, tool_tip = data
                  icon = icons[label]
  
                  self.label2id[label] = tool_id = wx.NewId()
  
                  self.AddSimpleTool(tool_id, label, icon,
                                     short_help_string=tool_tip)
  
                  self.ids_msgs[tool_id] = msg_type
  
                  self.parent.Bind(wx.EVT_TOOL, self.OnTool, id=tool_id)
  
              elif data[0] == "S":
                  # Separator
  
                  self.AddSeparator()
  
              elif data[0] == "C":
                  # Control
  
                  _, control, tool_tip = data
  
                  self.AddControl(control, label=tool_tip)
  
              elif data[0] == "O":
                  # Check tool / option button
  
                  _, label, tool_tip = data
                  icon = icons[label]
  
                  self.label2id[label] = tool_id = wx.NewId()
  
                  self.AddCheckTool(tool_id, label, icon, icon, tool_tip)
  
              else:
                  raise ValueError("Unknown tooltype " + str(data[0]))
  
          self.SetCustomOverflowItems([], [])
          self.Realize()
  
          # Adjust Toolbar size
          self.SetSize(self.DoGetBestSize())
docs: Adds tools from self.toolbardata to self