Ejemplo n.º 1
0
 def get_display_rect(self, index):
     c = self.control
     i1 = self.start_index
     i2 = index
     if i2 < i1:
         i1, i2 = i2, i1
     (x1, y1), (x2, y2) = get_bounds(i1, i2, c.bytes_per_row)
     extra = None
     w = x2 - x1 + 1
     h = y2 - y1 + 1
     if w > 0 or h > 0:
         extra = "rectangle: $%x x $%x" % (w, h)
     return extra
Ejemplo n.º 2
0
 def get_display_rect(self, index):
     c = self.canvas
     i1 = self.start_index
     i2 = index
     if i2 < i1:
         i1, i2 = i2, i1
     (x1, y1), (x2, y2) = get_bounds(i1, i2, c.bytes_per_row)
     extra = None
     w = x2 - x1 + 1
     h = y2 - y1 + 1
     if w > 0 or h > 0:
         extra = "rectangle: width=%d (0x%x), height=%d (0x%x)" % (w, w, h,
                                                                   h)
     return extra