Widget API
From WarCraft3
This API allow you to read from and manipulate widgets.
The three types of widgets are units, items, and destructables.
Code
//============================================================================
// Widget API
native GetWidgetLife takes widget whichWidget returns real
native SetWidgetLife takes widget whichWidget, real newLife returns nothing
native GetWidgetX takes widget whichWidget returns real
native GetWidgetY takes widget whichWidget returns real
constant native GetTriggerWidget takes nothing returns widgetConfused? Jass help forum!Using these natives when possible is faster than using a unit/item/destructable specific native.
Downcasting
The only way to downcast a widget (as this is needed in many cases when the only available event response is GetTriggerWidget) since patch 1.24b is to store it in a hashtable and retrieve it as a unit, item, or destructable.