Agent Based Model visualization in Gtk

Hi all-

I would like to create a simple 2D visualization of an agent based model in Gtk. My current approach involves creating a window and drawing colored rectangles to represent agents, following the online documentation. When I update the location, I need a way to “remove” the rectangle and draw a new one in the desired location. I was hoping to accomplish this by setting the previous location to the background color of the window. However, I cannot figure out how to get the background color. How can I get this information?

Alternatively, is there a better approach, such as adding a simple object and moving it to the desired location on each update, or perhaps something different?