IupSetStrAttribute

Definition: include pGUI.e

IupSetStrAttribute(Ihandle ih, string name, nullable_string val, sequence data={})
-- or --
IupStoreAttribute(Ihandle ih, string name, nullable_string val, sequence data={})
Description: Sets an interface element attribute.

ih: Identifier of the interface element. If NULL will set in the global environment.
name: name of the attribute.
val: val of the attribute. If NULL the default value will be used.
data: if a non-zero length sequence is passed, a sprintf(val,data) is performed.
Comments: This differs from IupSetAttribute in that only strings can be stored and the given value is internally duplicated.
As well as being useful for the implicit sprintf, this routine should be used instead of IupSetAttribute whenever val is volatile/temporary.

IupStoreAttribute is the old name for this function, not likely to be removed any time soon.

There are no separate wrappers for the C IupSetStrf* functions (old name: IupSetfAttribute), as that functionality is optionally available with IupSetStrAttribute().
Utility Functions The following procedures can also be used to set attributes from the element:

IupSetInt(Ihandles ih, string name, integer v)
IupSetIntId(Ihandle ih, string name, integer id, v)
IupSetIntId2(Ihandle ih, string name, integer lin, col, v)
IupSetFloat(Ihandle ih, string name, atom v)
IupSetFloatId(Ihandle ih, string name, integer id, atom v)
IupSetFloatId2(Ihandle ih, string name, integer lin, col, atom v)
IupSetDouble(Ihandle ih, string name, atom v)
IupSetDoubleId(Ihandle ih, string name, integer id, atom v)
IupSetDoubleId2(Ihandle ih, string name, integer lin, col, atom v)
IupSetRGB(Ihandle ih, string name, integer r, g, b)
IupSetRGBId(Ihandle ih, string name, integer id, r, g, b)
IupSetRGBId2(Ihandle ih, string name, integer lin, col, r, g, b)
IupSetStrAttributeId(Ihandle ih, string name, integer id, nullable_string v=NULL, sequence data={})
IupSetStrAttributeId2(Ihandle ih, string name, integer lin, col, nullable_string v=NULL, sequence data={})

id, lin, col: used when the attribute has additional ids.

IupStoreAttributeId is the old name for IupSetStrAttributeId, not likely to be removed any time soon.
IupStoreAttributeId2 is the old name for IupSetStrAttributeId2, not likely to be removed any time soon.

Id based attributes are always non inheritable, so all IupSet*Id functions will not propagate the attribute to the children.

All the utility functions use the IupSetStrAttribute* functions internally.
See Also: IupSetAttribute