A couple of years ago, a friend commented in a Slack that “there is no whiteboard / sketch application in macOS” readily available. Maybe there is and we did not know, but even at the time it was suggested that someting like https://jspaint.app might do the job. But the thing stayed at a corner of my mind.
About a week ago, I watched the ultimate introduction to pygame and the question returned. But now we also have LLMs to play some design and implentation ping pong and I started asking Claude a bit about that. And it was writing tons and tons of stuff where all was I wanted a bare whiteboard with no features at all. Something to (hand) draw lines on, no undo, no colors, not even a save image feature. And here is what I got:
import pygame
import sys
import argparse
options = argparse.ArgumentParser(description='Start a pygame window with configurable dimensions')
options.add_argument('--width', type=int, default=800, help='Window width (default: 800)')
options.add_argument('--height', type=int, default=600, help='Window height (default: 600)')
args = options.parse_args()
pygame.init()
screen = pygame.display.set_mode((args.width, args.height))
pygame.display.set_caption('pygame sketch')
clock = pygame.time.Clock()
a = (-1, -1)
screen.fill((250, 250, 160))
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
if event.type == pygame.MOUSEBUTTONUP:
a = (-1, -1)
mouse_buttons = pygame.mouse.get_pressed()
if mouse_buttons[0]:
if a[0] == -1:
a = pygame.mouse.get_pos()
else:
b = pygame.mouse.get_pos()
pygame.draw.line(screen, 'red', a, b, 2)
a = b
pygame.display.flip()
clock.tick(60)
I do not think I will make anything more with it. But it was a fun PoC , first time pygame application.


