Skip to content

API Reference / @gtkx/react / index / useParentWindow

Variable: useParentWindow

const useParentWindow: () => Gtk.Window | null

Defined in: hooks/use-parent-window.d.ts:9

Returns the Gtk.Window of the nearest window ancestor. This is null on the first render even inside a window, because a window provides itself only once its GObject exists, and stays null outside one. The component re-renders when it resolves, so derive from the value rather than reading it once.

Returns

Gtk.Window | null

Released under the MPL-2.0 License.