# Agent Based Model visualization in Gtk

**URL:** <https://discourse.julialang.org/t/agent-based-model-visualization-in-gtk/32518>\
**Category:** General Usage\
**Tags:** question\
**Created:** [December 20, 2019, 3:13pm UTC](https://discourse.julialang.org/t/agent-based-model-visualization-in-gtk/32518 "2019-12-20T15:13:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [December 20, 2019, 3:13pm UTC](https://discourse.julialang.org/t/agent-based-model-visualization-in-gtk/32518/1 "2019-12-20T15:13:51Z")

</div>

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](https://juliagraphics.github.io/Gtk.jl/latest/manual/canvas/). 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?
