gtkDialog :: Widget (React.Discrete a) -> GtkForm (Maybe a)
gtkDialog widget = gtkWidgetWindow Nothing widget' where
    widget' = stackLayout Vertical `layoutApply` do
        result <- fmap (fmap Just) (widgetNetwork widget)
        widgetNetwork $ gtkLabel Gtk.JustifyLeft ""  -- Line break
        widgetNetwork $ gtkButtonLayout Horizontal Gtk.ButtonboxEnd $ do
            cancel <- widgetNetwork $ fmap (fmap (const Nothing)) (gtkButtonStock Gtk.stockCancel False)
            ok <- widgetNetwork $ fmap (result React.<@) (gtkButtonStock Gtk.stockOk True)
            return $ React.union ok cancel

-- | A form that displays a text message and an Ok button.
gtkDialog :: Widget (React.Discrete a) -> GtkForm (Maybe a)
gtkDialog widget = gtkWidgetWindow Nothing widget' where
    widget' = stackLayout Vertical `layoutApply` do
        result <- fmap (fmap Just) (widgetNetwork widget)
        widgetNetwork $ gtkLabel Gtk.JustifyLeft ""  -- Line break
        widgetNetwork $ gtkButtonLayout Horizontal Gtk.ButtonboxEnd $ do
            cancel <- widgetNetwork $ fmap (fmap (const Nothing)) (gtkButtonStock Gtk.stockCancel False)
            ok <- widgetNetwork $ fmap (result React.<@) (gtkButtonStock Gtk.stockOk True)
            return $ React.union ok cancel

-- | A form that displays a text message and an Ok button.
gtkDialog widget = gtkWidgetWindow Nothing widget' where
    widget' = stackLayout Vertical `layoutApply` do
        result <- fmap (fmap Just) (widgetNetwork widget)
        widgetNetwork $ gtkLabel Gtk.JustifyLeft ""  -- Line break
        widgetNetwork $ gtkButtonLayout Horizontal Gtk.ButtonboxEnd $ do
            cancel <- widgetNetwork $ fmap (fmap (const Nothing)) (gtkButtonStock Gtk.stockCancel False)
            ok <- widgetNetwork $ fmap (result React.<@) (gtkButtonStock Gtk.stockOk True)
            return $ React.union ok cancel

-- | A form that displays a text message and an Ok button.