diff options
author | Aylur <[email protected]> | 2024-09-08 21:47:30 +0000 |
---|---|---|
committer | Aylur <[email protected]> | 2024-09-08 23:48:01 +0200 |
commit | bcf69173f4d16deffe905323c9ee2757529b7d1c (patch) | |
tree | f654a6349a4e09f65d1cd5321d0daefc550e0bae /docs | |
parent | da08ef940d287744c067cbff27ba17dbf8526c44 (diff) |
docs: how to create regular windows
Diffstat (limited to 'docs')
-rw-r--r-- | docs/ags/faq.md | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/docs/ags/faq.md b/docs/ags/faq.md index 56c13e4..ae3e4fc 100644 --- a/docs/ags/faq.md +++ b/docs/ags/faq.md @@ -269,3 +269,22 @@ notifd.notifications // ❌ // [!code error] notifd.get_notifications() // ✅ ``` + +## How to create regular floating windows + +Use `Gtk.Window` with [Widget.astalify](/ags/widget#how-to-use-non-builtin-gtk-widgets). + +By default `Gtk.Window` is destroyed on close. To prevent this add a handler for `delete-event`. + +```tsx {4-7} +const RegularWindow = Widget.astalify(Gtk.Window) + +return <RegularWindow + onDeleteEvent={(self) => { + self.hide() + return true + }} +> + {child} +</RegularWindow> +``` |