struct

Tryst::NativeWindow

Inherits Struct < Value < Object

The platform window identifier behind a Tk widget path - what any library embedding a foreign surface (a GPU renderer, a video frame, a browser view) has to be handed before it can draw into a window Tk owns.

A struct rather than a bare integer because the three platforms do not mean the same thing by it, and a caller passing one to the wrong API gets a crash rather than an error. The kind travels with the value so it can be checked.

Constructors

new(path : String, kind : NativeWindowKind, value : UInt64)
Source

Instance methods

covers_toplevel?

Whether the handle belongs to the whole toplevel rather than to this widget.

True on macOS, and it is not a detail: Tk on Aqua gives one NSWindow to a toplevel and none to the widgets inside it, so asking about a frame hands back its window's handle. Anything drawn into it covers the ENTIRE window, painting over every other Tk widget in it, wherever the frame happens to sit.

False on X11 and Windows, where each widget has a native window of its own and a surface embedded in one stays inside it.

Source
kind
Source
path

The Tk widget path this was taken for.

Source
pointer

The identifier as a pointer, for the two platforms where it is one. Raises on X11, where the value is a server-assigned number and treating it as an address would be nonsense.

Source
to_s(io : IO) : Nil

Same as #inspect(io).

Source
value

The identifier itself. Widened to 64 bits for all three: an X Window ID is 32 bits, the other two are pointers.

Source