diff options
author | Aylur <[email protected]> | 2024-12-19 21:32:48 +0100 |
---|---|---|
committer | Aylur <[email protected]> | 2024-12-19 21:32:48 +0100 |
commit | 61637d6333bd812021763039ceea61e7f7d29dbf (patch) | |
tree | bebdc24df1d5d0a9c7bf2c2f98376c1be341ee80 /docs/guide/typescript/faq.md | |
parent | 64150c7739049e3cc9b6b931eba58a635cbc24df (diff) | |
parent | c12fb05408c1cd1b1bca545fec636abda52f6755 (diff) |
Merge branch 'main' into feat/tray-gtk4
Diffstat (limited to 'docs/guide/typescript/faq.md')
-rw-r--r-- | docs/guide/typescript/faq.md | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/docs/guide/typescript/faq.md b/docs/guide/typescript/faq.md index a151099..4ee616b 100644 --- a/docs/guide/typescript/faq.md +++ b/docs/guide/typescript/faq.md @@ -92,7 +92,7 @@ printerr("print this line to stderr") ## Populate the global scope with frequently accessed variables -It might be annoying to always import Gtk only for `Gtk.Align` enums. +It might be annoying to always import Gtk only for the `Gtk.Align` enum. :::code-group @@ -118,7 +118,7 @@ Object.assign(globalThis, { :::code-group -```tsx [Bar.tsx] +```tsx [Bar.tsx] {3} export default function Bar() { return <window> <box halign={START} /> @@ -131,11 +131,13 @@ export default function Bar() { :::code-group ```ts [app.ts] -import "./globals" +import "./globals" // don't forget to import it first // [!code ++] import Bar from "./Bar" App.start({ - main: Bar + main() { + Bar() + } }) ``` @@ -197,11 +199,14 @@ These happen when accessing list type properties. Gjs fails to correctly bind import Notifd from "gi://AstalNotifd" const notifd = Notifd.get_default() -notifd.notifications // ❌ // [!code error] - -notifd.get_notifications() // ✅ +notifd.notifications // [!code --] +notifd.get_notifications() // [!code ++] ``` +:::tip +Open up an issue/PR to add a [workaround](https://github.com/Aylur/astal/blob/main/lang/gjs/src/overrides.ts). +::: + ## How to create regular floating windows Use `Gtk.Window` with [Widget.astalify](/guide/typescript/widget#how-to-use-non-builtin-gtk-widgets). |