# IupSetStrAttribute

Definition: | include pGUI.e IupSetStrAttribute(Ihandle ih, string name, nullable_string val, dword_seq args={})
Description: | Sets an interface element attribute. ih: Identifier of the interface element. name: name of the attribute. val: val of the attribute. If NULL the default value will be used. args: if a non-zero length sequence is passed, a sprintf(val,args) is performed.
pwa/p2js: | Supported. (But of the utility functions, as yet only IupSetInt, IupSetDouble, and IupToggleInt)
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, dword_seq args={}) IupSetStrAttributeId2(Ihandle ih, string name, integer lin, col, nullable_string v=NULL, dword_seq args={}) IupToggleInt(Ihandle ih, string name) [Phix specific, a trivial but handy IupSetInt(not IupGetInt()) wrapper] 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. While you can use IupGetAttribute (there is no IupGetStrAttribute) and the utility functions therein to retrieve global settings, and IupSetAttribute to set them, you cannot use these functions to set globals, use IupSetGlobal() and in particular IupSetGlobalInt() instead.
See Also: | IupSetAttribute