License
BSD-3-Clause
Copyright
Copyright © 2025 DDN (D Developer Network) Members
FLTK Widget Base Class
This module provides the base Widget class that wraps FLTK's Fl_Widget. All other widget types inherit from this class.
The Widget class provides:
Base class for all FLTK widgets.
This class wraps a low-level WidgetPtr handle and provides idiomatic D access to widget properties and methods. It does not own the handle by default - derived classes manage ownership.
Example:
// Usually you work with derived classes like Window or Button
auto button = new Button(10, 10, 100, 30, "Click");
button.x = 20; // Move button
button.visible = false; // Hide itWidgetPtr _handleThe underlying low-level widget handlebool _ownsHandleWhether this instance owns the handle and should delete itCallback _callbackStored callback delegateCallbackContext * _callbackContextCallback context for GC pinning and C bridgingvoid resize(int newX, int newY, int newWidth, int newHeight) nothrow @nogcResizes and repositions the widget.void label(string text)Sets the widget's label text.~thisDestroys the widget.