code: def setup_standalone_signals(instance):
      
      window = instance.get_widget('config-window')
      window.connect('delete-event', Gtk.main_quit)
  
      # We need to block the execution of the already associated
      # callback before connecting the new handler.
      button = instance.get_widget('button1')
      button.handler_block_by_func(instance.gtk_widget_destroy)
      button.connect('clicked', Gtk.main_quit)
  
      return instance
docs: Called when prefs dialog is running in standalone mode. It
      makes the delete event of dialog and click on close button finish
      the application.