Пример #1
0
 def _select(self):
     self._more = True
     p_list = []
     while self._more:
         p_list.append(self.point())
     s = Selection(self, p_list)
     s.repaint()
     return s
Пример #2
0
    def select_rect(self):
        p_list = []

        x0,y0 = self._get_point()
        if not x0 or not y0:
            return

        x1,y1 = self._get_point(rubberbox=(x0,y0))
        if not x1 or not y1:
            return

        l = self.find_enclosed(x0, y0, x1, y1)
        if not l:
            return
        
        l = map(lambda x:self.gettags(x)[0], l)
        for i in l:
            if i[0] == "P":
                p_list.append(self.items[i])
        s = Selection(self, p_list)
        s.repaint()
        return s