Returns the name of an interface element attribute. See also the Attributes Guide section.
char *IupGetAttribute(Ihandle *ih, const char *name); [in C]
iup.GetAttribute(ih: ihandle, name: string) -> value: string [in Lua]
ih: Identifier of the interface element. If
NULL will retrieve from the global environment.
name: name of the attribute.
Returns: the attribute value or NULL (nil in Lua)
if
the attribute is not defined or does not exist.
See the Attributes Guide for more details.
This function return value is not necessarily the same pointer used by the application to define the attribute value. The pointers of internal IUP attributes returned by IupGetAttribute must never be freed or changed.
When the attribute is retrieved it is first checked at the element class implementation. If not defined then it checks in the hash table. If not defined, the attribute will be inherited from its parent hash table and so forth, until it reaches the dialog. But if still then the attribute is not defined a default value for the element is returned (the default value can also be NULL). Inheritance can be blocked by the element class implementation.
In IupLua, only known internal pointer attributes are returned as user data or as an ihandle, all other attributes are returned as strings. To access attribute data always as user data use iup.GetAttributeData:
iup.GetAttributeData(ih: ihandle) -> value: userdata [in Lua]
IupSetAttribute, IupGetInt, IupGetFloat, IupSetAttributes, IupGetHandle.