def _get_height(self): gc = PlotGraphicsContext((100, 100), dpi=72) gc.set_font(self.label_font) (w, h, descent, leading) = gc.get_full_text_extent(self.label) return self._image.height() + h
def _get_width(self): gc = PlotGraphicsContext((100, 100), dpi=72) gc.set_font(self.label_font) (w, h, descent, leading) = gc.get_full_text_extent(self.label) return max(self._image.width(), w)