Button* GUIControl.AsButton;
InvWindow* GUIControl.AsInvWindow;
Label* GUIControl.AsLabel;
ListBox* GUIControl.AsListBox;
Slider* GUIControl.AsSlider;
TextBox* GUIControl.AsTextBox;
Converts a generic GUIControl* pointer into a variable of the correct type, and returns
it. If the control is not of the requested type, returns null.
Example:
Button *theButton = gIconbar.Controls[2].AsButton;
if (theButton == null) {
Display("Control 2 is not a button!!!!");
}
else {
theButton.NormalGraphic = 44;
}
attempts to set Button 2 on GUI ICONBAR to have NormalGraphic 44, but if that
control is not a button, prints a message.
See Also: GUI.Controls
|