### Function

# Gtk DrawingAreaDrawFunc

since: 4.0

#### Declaration

    void
    (* GtkDrawingAreaDrawFunc) (
      GtkDrawingArea* drawing_area,
      cairo_t* cr,
      int width,
      int height,
      gpointer user_data
    )

#### Description [src]

Whenever `drawing_area` needs to redraw, this function will be called.

This function should exclusively redraw the contents of the drawing area and must not call any widget functions that cause changes.

Available since: 4.0

#### Parameters

`drawing_area`

  Type: `GtkDrawingArea`

  The `GtkDrawingArea` to redraw.

  The data is owned by the caller of the function.

`cr`

  Type: `cairo_t`

  The context to draw to.

  The data is owned by the caller of the function.

`width`

  Type: `int`

  The actual width of the contents. This value will be at least as wide as GtkDrawingArea:width.

`height`

  Type: `int`

  The actual height of the contents. This value will be at least as wide as GtkDrawingArea:height.

`user_data`

  Type: `gpointer`

  User data.

  The argument can be `NULL`.
  The data is owned by the caller of the function.