   @init_density 0.1  # From 0 to 1.
 
   def start do
-    screen = Screen.init("Game of Life", @width, @height, @cell_size,
-                         &render/2)
+    screen = Screen.init("Game of Life", @width, @height, @cell_size)
     create_random_grid(@width, @height) |> run(@width, @height, screen)
   end
 
   def run(grid, width, height, screen) do
-    Screen.update screen, grid: grid, width: width, height: height
+    Screen.update screen, &(render &1, grid, width, height)
     Process.sleep @interval
     grid |> make_step(width, height) |> run(width, height, screen)
   end

    elem(elem(grid, y), x)
  end

  def render(dc, grid: grid, width: width, height: height) do
    for y <- 0..(height-1) do
      for x <- 0..(width-1) do
        if grid_elem(grid, x, y) do

    frame = :wxFrame.new(
      :wx.null, wxID_ANY, title, size: {width, height},
       style: wxSYSTEM_MENU ||| wxMINIMIZE_BOX  ||| wxCLOSE_BOX ||| wxCAPTION)
    :wxFrame.show frame
    frame
  end
end

