summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAylur <[email protected]>2024-09-08 21:47:30 +0000
committerAylur <[email protected]>2024-09-08 23:48:01 +0200
commitbcf69173f4d16deffe905323c9ee2757529b7d1c (patch)
treef654a6349a4e09f65d1cd5321d0daefc550e0bae /docs
parentda08ef940d287744c067cbff27ba17dbf8526c44 (diff)
docs: how to create regular windows
Diffstat (limited to 'docs')
-rw-r--r--docs/ags/faq.md19
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>
+```