Intuition manual

From Amiga Development Wiki
Revision as of 13:17, 30 August 2015 by AmigaDeveloper (Talk | contribs) (Setting and getting attributes)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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);