---
name: "init_dialog"
section: "3alleg"
platform: "linux"
package: "liballegro-doc"
version: "2:4.2.2-2.2"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/init_dialog"
---

# init\_dialog(3alleg)

Low level initialisation of a dialog. Allegro game programming library.

## NAME

init\_dialog - Low level initialisation of a dialog. Allegro game programming library.

## SYNOPSIS

**#include \<allegro.h\>**

**DIALOG\_PLAYER \*init\_dialog(DIALOG \*dialog, int focus\_obj);**

## DESCRIPTION

This function provides lower level access to the same functionality as do\_dialog(), but allows you to combine a dialog box with your own program  control structures. It initialises a dialog, returning a pointer to a  player object that can be used with update\_dialog() and  shutdown\_dialog(). With these functions, you could implement your own  version of do\_dialog() with the lines:

```
   DIALOG_PLAYER *player = init_dialog(dialog, focus_obj);
   while (update_dialog(player))
      ;
   return shutdown_dialog(player);
```

Note that you are responsible for showing and hiding the mouse cursor, which do\_dialog would otherwise do for you, or saving and restoring the screen contents, as popup\_dialog would do for you.

## SEE ALSO

[**update\_dialog**(3alleg)](/update_dialog/3alleg.md), [**shutdown\_dialog**(3alleg)](/shutdown_dialog/3alleg.md), [**do\_dialog**(3alleg)](/do_dialog/3alleg.md)
