Ejemplo n.º 1
0
 def _multi_selected_items_changed(self, event):
     """ Handles the editor's 'multi_selected' trait being modified.
     """
     if not self._no_update:
         try:
             added = [self.value.index(item) for item in event.added]
             removed = [self.value.index(item) for item in event.removed]
         except ValueError:
             pass
         else:
             event = TraitListEvent(0, added, removed)
             self._multi_selected_indices_items_changed(event)
Ejemplo n.º 2
0
 def _multi_selected_items_changed(self, event):
     """ Handles the editor's 'multi_selected' trait being modified.
     """
     values = self.value
     try:
         self._multi_selected_rows_items_changed(
             TraitListEvent(
                 index=0,
                 removed=[values.index(item) for item in event.removed],
                 added=[values.index(item) for item in event.added],
             ))
     except:
         pass
 def test_list_event_kwargs_only(self):
     with self.assertRaises(TypeError):
         TraitListEvent(slice(0, 3, 2), [1, 3], [4, 5])