### Method

# Atk Text get_selection

#### Declaration [src]

    gchar*
    atk_text_get_selection (
      AtkText* text,
      gint selection_num,
      gint* start_offset,
      gint* end_offset
    )

#### Description [src]

Gets the text from the specified selection.

#### Parameters

`selection_num`

  Type: `gint`

  The selection number. The selected regions are assigned numbers that correspond to how far the region is from the start of the text. The selected region closest to the beginning of the text region is assigned the number 0, etc. Note that adding, moving or deleting a selected region can change the numbering.

`start_offset`

  Type: `gint*`

  Passes back the starting character offset of the selected region.

  The argument will be set by the function.

`end_offset`

  Type: `gint*`

  Passes back the ending character offset (offset immediately past) of the selected region.

  The argument will be set by the function.

#### Return value

Type: `gchar*`

A newly allocated string containing the selected text. Use `g_free()` to free the returned string.

The caller of the method takes ownership of the returned data, and is responsible for freeing it.
The value is a NUL terminated UTF-8 string.