Plugins can register new widget types that RWML layout files can use just like built-in widgets. A custom widget is a C# class that implementsDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ryzhpolsos/redeye/llms.txt
Use this file to discover all available pages before exploring further.
IShellWidget — typically by extending the BaseShellWidget abstract base, which handles positioning, styling, tooltip wiring, and thread-safe control updates for you. Once exported, users reference your widget in RWML using the pluginId.widgetName element name.
Creating a custom widget
Create a class that extends BaseShellWidget
Subclass
RedEye.UI.BaseShellWidget. You must assign Control to a WinForms control in Initialize() before the base infrastructure can operate on it.BaseShellWidget inherits from IShellWidget and also implements IComponent. You never need to implement SetManager, GetControl, SetConfig, GetConfig, Update, Modify, or the event infrastructure yourself.Override UpdateConfig() to read RWML attributes
UpdateConfig() is called before every render cycle. Call base.UpdateConfig() first to populate the standard ShellWidgetConfig fields (position, size, colors, font, etc.), then read any additional attributes specific to your widget from Node.Override UpdateControl() to update the WinForms control
UpdateControl() is called after UpdateConfig() to push the current state into the control. Call the base implementation first so that standard layout properties (position, size, colors, font, dock, anchor) are applied, then update your control’s specific state.Override PostInitialize() for deferred setup (optional)
PostInitialize() runs after all widgets in the layout have been initialised. Use it when your widget needs to reference another widget by ID (via Config.Parent) or react to the fully-built widget tree. The base implementation wires up the Parent control relationship and tooltip mouse events.Call ExportWidget in your plugin's Main()
From your
Plugin subclass, call ExportWidget<T>(name) to register the widget type. The full name in RWML will be pluginId.name.ShellWidgetConfig — standard widget fields
BaseShellWidget.UpdateConfig() maps RWML attributes to a ShellWidgetConfig instance stored in Config. These fields are available to every widget that calls base.UpdateConfig():
| Field | RWML attribute | Type | Description |
|---|---|---|---|
Id | id | string | Widget identifier for cross-widget references. Auto-generated if omitted. |
X | x | int | Left position in pixels. |
Y | y | int | Top position in pixels. |
Width | width | int | Width in pixels. |
Height | height | int | Height in pixels. |
AutoSize | autoSize | bool | Let the control size itself. |
Dock | dock | string | WinForms DockStyle value (e.g. fill, top). |
Anchor | anchor | string | WinForms AnchorStyles value. |
Color | color | string | Foreground color as a hex string. |
BackgroundColor | backgroundColor | string | Background color as a hex string. |
Padding | padding | string | Control padding. |
Margin | margin | string | Control margin. |
Font | font | string | Font string (e.g. "Segoe UI, 11"). |
UpdateInterval | updateInterval | int | Polling interval in milliseconds. 0 disables the timer. |
ToolTip | toolTip | string | Tooltip text shown on hover. |
Layer | layer | int | Z-order layer. Defaults to -1. |
IsTransparent | isTransparent | bool | Renders the control background as transparent. |
Parent | parent | string | ID of a parent widget to nest this control inside. |
Complete example — clock widget
Implementing IShellWidget directly
IfBaseShellWidget does not fit your use case (for example, you are wrapping a non-WinForms UI framework or need full control over every lifecycle call), implement IShellWidget directly. You must implement all interface members: Initialize, PostInitialize, GetNode, SetNode, GetConfig, SetConfig, UpdateConfig, GetContainer, SetContainer, GetWindow, SetWindow, GetControl, UpdateControl, Update, Modify, and RegisterEventHandler. You also need to implement IComponent.SetManager and IComponent.Initialize (from the parent IComponent interface). See IShellWidget API for the full interface contract.