_windowCloseEvent :: Gtk.Window -> React.NetworkDescription (React.Event ())
_windowCloseEvent window = React.fromAddHandler add where 
    add :: React.AddHandler ()
    add handler = do
        cid <- window `Gtk.on` Gtk.deleteEvent $ Gtk.tryEvent (liftIO (handler ()))
        return (Gtk.signalDisconnect cid)

-- | Turns a 'Widget' producing 'Discrete' values of type @a@ into a form returning either:
--
-- * 'Just' the value of the widget at the time the /Ok/ button was pressed;
-- 
-- * 'Nothing'; in case the /Cancel/ button was pressed, or the dialog was closed using the close button.
_windowCloseEvent :: Gtk.Window -> React.NetworkDescription (React.Event ())
_windowCloseEvent window = React.fromAddHandler add where 
    add :: React.AddHandler ()
    add handler = do
        cid <- window `Gtk.on` Gtk.deleteEvent $ Gtk.tryEvent (liftIO (handler ()))
        return (Gtk.signalDisconnect cid)

-- | Turns a 'Widget' producing 'Discrete' values of type @a@ into a form returning either:
--
-- * 'Just' the value of the widget at the time the /Ok/ button was pressed;
-- 
-- * 'Nothing'; in case the /Cancel/ button was pressed, or the dialog was closed using the close button.
_windowCloseEvent window = React.fromAddHandler add where 
    add :: React.AddHandler ()
    add handler = do
        cid <- window `Gtk.on` Gtk.deleteEvent $ Gtk.tryEvent (liftIO (handler ()))
        return (Gtk.signalDisconnect cid)

-- | Turns a 'Widget' producing 'Discrete' values of type @a@ into a form returning either:
--
-- * 'Just' the value of the widget at the time the /Ok/ button was pressed;
-- 
-- * 'Nothing'; in case the /Cancel/ button was pressed, or the dialog was closed using the close button.