code: def attach(self, gui, name=None):
          
  
          # Disable keyboard pan so that we can use arrows as global shortcuts
          # in the GUI.
          self.panzoom.enable_keyboard_pan = False
  
          gui.add_view(self)
          self.gui = gui
  
          # Set the view state.
          self.set_state(gui.state.get_view_state(self))
  
          # Call on_select() asynchronously after a delay, and set a busy
          # cursor.
          self.async_caller = AsyncCaller(delay=self._callback_delay)
  
          @gui.connect_
          def on_select(cluster_ids, **kwargs):
              # Call this function after a delay unless there is another
              # cluster selection in the meantime.
              @self.async_caller.set
              def update_view():
                  with busy_cursor():
                      self.on_select(cluster_ids, **kwargs)
  
          self.actions = Actions(gui,
                                 name=name or self.__class__.__name__,
                                 menu=self.__class__.__name__,
                                 default_shortcuts=self.shortcuts)
  
          # Update the GUI status message when the `self.set_status()` method
          # is called, i.e. when the `status` event is raised by the VisPy
          # view.
          @self.connect
          def on_status(e):
              gui.status_message = e.message
  
          # Save the view state in the GUI state.
          @gui.connect_
          def on_close():
              gui.state.update_view_state(self, self.state)
              # NOTE: create_gui() already saves the state, but the event
              # is registered *before* we add all views.
              gui.state.save()
  
          self.show()
docs: Attach the view to the GUI.