EBackend.UserPrompter.prompt_sync

### Method

# EBackend UserPrompterprompt_sync

since: 3.8

#### Declaration [src]

    gint
    e_user_prompter_prompt_sync (
      EUserPrompter* prompter,
      const gchar* type,
      const gchar* title,
      const gchar* primary_text,
      const gchar* secondary_text,
      gboolean use_markup,
      GList* button_captions,
      GCancellable* cancellable,
      GError** error
    )

#### Description [src]

Prompts a user for a decision.

The `type` can be one of “info”, “warning”, “question” or “error”, to include an icon in the message prompt; anything else results in no icon in the message.

If `button_captions` is `NULL` or empty list, then only one button is shown in the prompt, a “Dismiss” button.

If an error occurred, the function sets `error` and returns -1.

Available since: 3.8

#### Parameters

`type`

  Type: `const gchar*`

  Type of the prompt; can be `NULL`.

  The argument can be `NULL`.
  The data is owned by the caller of the method.
  The value is a NUL terminated UTF-8 string.

`title`

  Type: `const gchar*`

  Window title of the prompt; can be `NULL`.

  The argument can be `NULL`.
  The data is owned by the caller of the method.
  The value is a NUL terminated UTF-8 string.

`primary_text`

  Type: `const gchar*`

  Primary text of the prompt; can be `NULL`.

  The argument can be `NULL`.
  The data is owned by the caller of the method.
  The value is a NUL terminated UTF-8 string.

`secondary_text`

  Type: `const gchar*`

  Secondary text of the prompt; can be `NULL`.

  The argument can be `NULL`.
  The data is owned by the caller of the method.
  The value is a NUL terminated UTF-8 string.

`use_markup`

  Type: `gboolean`

  Whether both texts are with markup.

`button_captions`

  Type: A list of `utf8`

  Captions of buttons to use in the message; can be `NULL`.

  The argument can be `NULL`.
  The data is owned by the caller of the method.
  Each element is a NUL terminated UTF-8 string.

`cancellable`

  Type: `GCancellable`

  Optional `GCancellable` object, or `NULL`.

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

`error`

  Type: `GError **`

  The return location for a recoverable error.

  The argument can be `NULL`.
  If the return location is not `NULL`, then you must initialize it to a `NULL` `GError*`.
  The argument will be left initialized to `NULL` by the method if there are no errors.
  In case of error, the argument will be set to a newly allocated `GError`; the caller will take ownership of the data, and be responsible for freeing it.

#### Return value

Type: `gint`

0-based index of a button being used by a user as a response, corresponding to `button_captions` list.