From bcf69173f4d16deffe905323c9ee2757529b7d1c Mon Sep 17 00:00:00 2001 From: Aylur Date: Sun, 8 Sep 2024 21:47:30 +0000 Subject: docs: how to create regular windows --- docs/ags/faq.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'docs/ags/faq.md') 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 { + self.hide() + return true + }} +> + {child} + +``` -- cgit v1.2.3