C4 Engine
C4 Engine API Documentation

Widget::ActivateWidget

Defined in:  C4Widgets.h
Posts an activate widget event.
Prototype

void ActivateWidget(Node *initiator = nullptr);

Parameters
initiator The node that caused the widget to be activated.
Description
The ActivateWidget function should be called when a widget should be activated. Tthe ActivateWidget function is provided for convenience, and calling it is equivalent to making the following call:
PostWidgetEvent(WidgetEventData(kEventWidgetActivate, initiator));
The initiator parameter should be set to a node that caused the widget to be activated, if any. If the ActivateWidget function is called from a script method, for example, then the initiator parameter should be set to the node returned by the ScriptState::GetInitiatorNode function. A widget should always return immediately after calling the ActivateWidget function because the observer that receives the event is allowed to destroy the widget in response to the event.
See Also

Widget::PostWidgetEvent

Widget::HandleMouseEvent

Widget::HandleKeyboardEvent

WidgetEventData