Use update() to redraw the widget rather than repaint()