Event handling and a primitive paint application