deft.widget

Widget base class and the geometry primitives it works with.

A Widget owns a single native window handle (HWND) and the common operations over it: visibility, bounds, enablement, focus and deterministic teardown. Window (top-level windows) and Control (common controls) both derive from it.

Handle lifetime: a widget owns its HWND. Because D's garbage collector is non-deterministic, call dispose() for prompt, predictable cleanup — it destroys the native window and unregisters the widget. While a widget's HWND is alive the widget is pinned as a GC root so it cannot be collected out from under the message loop.

Members

Classes

Widget
class Widget

Abstract base for everything that owns a native window.

Functions

firstFocusableIn
HWND firstFocusableIn(Widget[] kids)

The handle of the first focusable control among kids, searched depth-first.

Structs

Padding
struct Padding

Per-edge spacing in device pixels.

Rect
struct Rect

An axis-aligned rectangle in device pixels.

Size
struct Size

A width/height pair in device pixels.

Meta