Exemplo n.º 1
0
 def _multi_selected_items_changed(self, event):
     """ Handles the editor's 'multi_selected' trait being modified.
     """
     values = self.values
     try:
         self._multi_selected_rows_items_changed(TraitListEvent(0, [values.index(
             item) for item in event.removed], [values.index(item) for item in event.added]))
     except:
         pass
Exemplo n.º 2
0
 def _multi_selected_items_changed(self, event):
     values = self.value
     try:
         added = [values.index(item) for item in event.added]
         removed = [values.index(item) for item in event.removed]
     except:
         pass
     else:
         list_event = TraitListEvent(0, added, removed)
         self._multi_selected_rows_items_changed(list_event)
Exemplo n.º 3
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(index=0, added=added, removed=removed)
             self._multi_selected_indices_items_changed(event)
Exemplo n.º 4
0
 def _multi_selected_items_changed(self, event):
     """Handles the editor's 'multi_selected' trait being modified."""
     values = self.value
     try:
         self._multi_selected_indices_items_changed(
             TraitListEvent(
                 index=0,
                 removed=[values.index(item) for item in event.removed],
                 added=[values.index(item) for item in event.added],
             )
         )
     except Exception:
         pass
 def test_list_event_kwargs_only(self):
     with self.assertRaises(TypeError):
         TraitListEvent(slice(0, 3, 2), [1, 3], [4, 5])