Exemplo n.º 1
0
 def _move_win(self, direction):
     if self.cur is not None:
         try:
             index = util.clamp2(self.cur + direction.num, self.n_items())
             util.swap(self.windows, self.cur, index)
             self.cur = index
         except IndexError:
             util.debug("Bad index for moving window")
Exemplo n.º 2
0
 def _move_win(self, direction):
     if self.cur is not None:
         try:
             index = util.clamp2(self.cur + direction.num, self.n_items())
             util.swap(self.windows, self.cur, index)
             self.cur = index
         except IndexError:
             util.debug("Bad index for moving window")
Exemplo n.º 3
0
 def close_win(self):
     if self.cur is not None:
         try:
             del self.windows[self.cur]
             self.cur = util.clamp2(self.cur - 1, self.n_items())
             if self.windows == []:
                 self.cur = None
         except IndexError:
             util.debug("Bad index removing window from stack")
Exemplo n.º 4
0
 def close_win(self):
     if self.cur is not None:
         try:
             del self.windows[self.cur]
             self.cur = util.clamp2(self.cur - 1, self.n_items())
             if self.windows == []:
                 self.cur = None
         except IndexError:
             util.debug("Bad index removing window from stack")