def __missing__(self, key):
        if self.default_factory is None:
            raise KeyError(key)
        else:
            ret = self[key] = self.default_factory(name=key)
            return ret
def _on_item_widget_key_press_event(self, widget, event, item):
    if event.state & gtk.gdk.MOD1_MASK:     # Alt key
      key_name = gtk.gdk.keyval_name(event.keyval)
      if key_name in ["Up", "KP_Up"]:
        self.reorder_item(
          item, self._get_item_position(item) - 1)
      elif key_name in ["Down", "KP_Down"]:
        self.reorder_item(
          item, self._get_item_position(item) + 1)