def paintEvent(self, event):
        if not self.pixmap:
            return
        rect = event.rect()
        self.repaint(rect)
When an area of the window is exposed, we just copy out of the
dataset/ETHPy150Open ejeschke/ginga/ginga/qtw/ColorBar.py/ColorBar.paintEvent