IupSetAttributes

IUP - Portable User Interface

IupSetAttributes

Defines a set of attributes for an interface element. This function keeps a copy of the attributes’ parameters.

Parameters/Return

Ihandle *IupSetAttributes(Ihandle *ih, char *str); [in C]
iup.SetAttributes(ih: iuplua_tag, str: string) -> ih: iulua_tag [in Lua] 

ih: Identifier of the interface element.
str: string with the attributes in the format "v1=a1, v2=a2,..." where vi is the name of an attribute and ai is its value.

This function returns ih if all attributes were defined, or NULL (nil in Lua) otherwise.

Examples

This function returns the same Ihandle it receives. This way, it is a lot easier to create dialogs in C.

dialog = IupSetAttributes(
  IupDialog(
    IupVBox(
      IupSetAttributes(IupFill(), "SIZE = 5"),
      IupHBox(
        IupSetAttributes(IupFill(), "SIZE = 5"),
        canvas = IupSetAttributes(IupCanvas("repaind_cb"), "BORDER=NO, RASTERSIZE=100x100"),
        IupSetAttributes(IupFill(), "SIZE = 5"),
        NULL),
      IupSetAttributes(IupFill(), "SIZE = 5"),
      NULL)), 
  "TITLE = Teste")

Creates a list with country names and defines Japan as the selected option.

Ihandle *lista = IupList ("acao_lista");
IupSetAttributes(lista,"VALUE=3,1=Brazil,2=USA,3=Japan,4=France");

See Also

IupGetAttribute, IupSetAttribute, IupGetAttributes, IupStoreAttribute