Intuition manual

From Amiga Development Wiki
Jump to: navigation, search

Setting and getting attributes

You can access the attributes of BOOPSI objects with GetAttr() and SetAttrs() calls.

ULONG success = GetAttr(ULONG AttrID, APTR obj, ULONG *value);
ULONG retval = SetAttrs(APTR obj, Tag tag1, ULONG val1, ..., TAG_DONE);
ULONG retval = SetAttrsA(APTR obj, CONST struct TagItem *taglist);

Typically GetAttr() is wrapped to getv() function for convenience:

IPTR getv(APTR obj, ULONG AttrID)
{
   IPTR val;
   GetAttr(AttrID, obj, &val);
   return val;
}

SetAttrs() is used to set attributes:

SetAttrs(obj, MUIA_Disabled, TRUE, TAG_DONE);