IupGetAttribute

Returns the name of an interface element attribute. See also the Attributes Guide section.

Parameters/Return

char *IupGetAttribute(Ihandle *ih, const char *name); [in C]
iup.GetAttribute(ih: ihandle, name: string) -> value: string [in Lua] char *IupGetAttributeId(Ihandle *ih, const char *name, int id); [in C]
iup.GetAttributeId(ih: ihandle, name: string, id: number) -> value: string [in Lua]

ih: Identifier of the interface element. If NULL will retrieve from the global environment.
name: name of the attribute.
id: used when the attribute has an additional id.

Returns: the attribute value or NULL (nil in Lua) if the attribute is not defined or does not exist.

Notes

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 should never be freed or changed, except when you allocated the memory for that pointer at set it using IupSetAttribute.

IupLua

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]

Examples

Browse for Example Files

See Also

IupSetAttribute, IupGetInt, IupGetFloat, IupSetAttributes, IupGetHandle.