IUP: Attribute Environment

IUP - Portable User Interface

Attribute Environment
[Control SDK]


Detailed Description

The attributes that are not stored at the control, are stored in a hash table (see Hash Table).
As a general rule use:
  • IupGetAttribute, IupSetAttribute, ... : when care about control implementation, inheritance, hash table and default value
  • iupAttribGetStr, iupAttribSetStr, ... : when NOT care, ONLY access the hash table
  • iupAttribGetStrDefault : same as iupAttribGetStr, but checks the default value These different functions have very different performances and results. So use them wiselly.
See iup_attrib.h


Functions

int iupAttribIsInternal (const char *name)
int iupAttribIsPointer (const char *name)
int iupAttribIsInheritable (const char *name)
void iupAttribSetStr (Ihandle *ih, const char *name, char *value)
void iupAttribStoreStr (Ihandle *ih, const char *name, const char *value)
void iupAttribSetStrf (Ihandle *ih, const char *name, const char *format,...)
void iupAttribSetInt (Ihandle *ih, const char *name, int num)
void iupAttribSetFloat (Ihandle *ih, const char *name, float num)
char * iupAttribGetStr (Ihandle *ih, const char *name)
char * iupAttribGetStrDefault (Ihandle *ih, const char *name)
int iupAttribGetInt (Ihandle *ih, const char *name)
int iupAttribGetIntDefault (Ihandle *ih, const char *name)
float iupAttribGetFloat (Ihandle *ih, const char *name)
float iupAttribGetFloatDefault (Ihandle *ih, const char *name)

Function Documentation

int iupAttribIsInternal const char *  name  ) 
 

Returns true if the attribute name if in the internal format "_IUP...".

int iupAttribIsPointer const char *  name  ) 
 

Returns true if the attribute name is a known pointer.

int iupAttribIsInheritable const char *  name  ) 
 

Returns true if the attribute is inheritable. valid only for a small group of common attributes. Not used internally. The inheritance in handled directly by the Attribute Function registration in the Base Class.

void iupAttribSetStr Ihandle *  ih,
const char *  name,
char *  value
 

Sets the attribute only in the attribute environment as a pointer. It ignores children.

void iupAttribStoreStr Ihandle *  ih,
const char *  name,
const char *  value
 

Sets the attribute only in the attribute environment as a string. The string is internally duplicated. It ignores children.

void iupAttribSetStrf Ihandle *  ih,
const char *  name,
const char *  format,
  ...
 

Sets the attribute only in the attribute environment as a string. The string is internally duplicated. Use same format as sprintf. It ignores children.

void iupAttribSetInt Ihandle *  ih,
const char *  name,
int  num
 

Sets an integer attribute only in the attribute environment. It will be stored as a string. It ignores children.

void iupAttribSetFloat Ihandle *  ih,
const char *  name,
float  num
 

Sets an floating point attribute only in the attribute environment. It will be stored as a string. It ignores children.

char* iupAttribGetStr Ihandle *  ih,
const char *  name
 

Returns the attribute from the attribute environment. It ignores inheritance.

char* iupAttribGetStrDefault Ihandle *  ih,
const char *  name
 

Returns the attribute from the attribute environment, but if not defined then returns the registered default value if any. It ignores inheritance.

int iupAttribGetInt Ihandle *  ih,
const char *  name
 

Returns the attribute from the attribute environment as an integer. It ignores inheritance.

int iupAttribGetIntDefault Ihandle *  ih,
const char *  name
 

Returns the attribute from the attribute environment as an integer, but if not defined then returns the registered default value if any. It ignores inheritance.

float iupAttribGetFloat Ihandle *  ih,
const char *  name
 

Returns the attribute from the attribute environment as a floating point. It ignores inheritance.

float iupAttribGetFloatDefault Ihandle *  ih,
const char *  name
 

Returns the attribute from the attribute environment as a floating point, but if not defined then returns the registered default value if any. It ignores inheritance.