## HdyDialog HdyDialog — An adaptive dialog. |

## Functions

GtkWidget * | hdy_dialog_new ()
gboolean | hdy_dialog_get_narrow ()

## Properties

gboolean | narrow | Read

## Types and Values

#define | HDY_TYPE_DIALOG
| HdyDialogClass
| HdyDialog

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GtkWidget
                ╰── GtkContainer
                    ╰── GtkBin
                        ╰── GtkWindow
                            ╰── GtkDialog
                                ╰── HdyDialog

## Implemented Interfaces

HdyDialog implements AtkImplementorIface and GtkBuildable.

## Description

A GtkDialog that adapts to smaller displays.

Small is defined as:

    1
    2
    is_small = ((             width <= 400 && height <= 800) ||
                (maximized && width <= 800 && height <= 400));

In the smaller view a HdyDialog matches its size to that of its parent and for "Presentation Dialogs" uses a back button rather than close button to dismiss.

It's recommended that dialog contents are wrapped in a GtkScrolledWindow to ensure they don't overflow the screen.

HdyDialog works best when “use-header-bar” is `TRUE` (which is the case when using `hdy_dialog_new()`).

Design Information: GitLab Issue

Ideally when using HdyDialog you shouldn't need to know you are using it rather than GtkDialog however there are some notable differences: “modal” is `TRUE` by default as is “destroy-with-parent” as the behaviour demonstrated by HdyDialog would be a bad user experience when not modal.

If you want to replace the titlebar by your own, we recommend using HdyHeaderBar as it will retain the abiity to present a back button when the dialog is small. HdyHeaderBar doesn't have to be its direct child and you can use any complex contraption you like as the dialog's titlebar.

## Functions

### hdy_dialog_new ()

    GtkWidget *
    hdy_dialog_new (GtkWindow *parent);

Create a HdyDialog with “transient-for” set to parent

C Usage

    1
    GtkWidget *dlg = hdy_dialog_new (GTK_WINDOW (main_window));

Vala Usage

    1
    var dlg = new Hdy.Dialog (main_window);

Python Usage

    1
    dlg = Handy.Dialog.new (main_window);

#### Parameters

parent | GtkWindow this dialog is a child of |

Since: 0.0.7

### hdy_dialog_get_narrow ()

    gboolean
    hdy_dialog_get_narrow (HdyDialog *self);

Gets whether `self` is narrow.

#### Parameters

self | a HdyDialog |

#### Returns

`TRUE` if `self` is narrow, `FALSE` otherwise.

Since: 0.0.11

## Types and Values

### HDY_TYPE_DIALOG

    #define HDY_TYPE_DIALOG (hdy_dialog_get_type())

### HdyDialogClass

    typedef struct {
      GtkDialogClass parent_class;
    } HdyDialogClass;

### HdyDialog

    typedef struct _HdyDialog HdyDialog;

## Property Details

### The `“narrow”` property

      “narrow”                   gboolean

`TRUE` if the dialog is narrow.

Owner: HdyDialog

Flags: Read

Default value: FALSE

Since: 0.0.11

## See Also

HdyHeaderBar