The Intuition function newobjecta() creates a boopsi object: mynewobject = APTR NewObjectA(Class *privclass, UBYTE *pubclass, struct TagItem *myattrs) The pointer that newobjecta() returns is a pointer to a boopsi object. in general, Boopsi objects are "black boxes". This means the inner workings of Boopsi objects are not visible to the application programmer, so the programmer does not know what goes on inside it. This really means the inner workings of these objects are none of your business. Unless otherwise documented, only use an object pointer as a handle to the object. To create an object, newobjecta() needs to know what class the new object is an instance of. To create a public class object, pass a NULL pointer in privclass and an ASCII string in pubclass naming the object's public class. The privclass pointer is used to create a private class object, which is covered in the "creating a boopsi class" section later in this chapter. The myattrs tag list is a list of tag/value pairs, each of which contains an initial value for some object attribute. Most objects have a set of attributes associated with them, so each attribute has a tag name. For Boopsi gadgets and images, the attributes include some of the values from the old gadget and image structures (position, size, etc.). Most applications use the stack-based version of newobjecta(), newobject(), to create objects. this allows an application to build the tag list of object attributes on the stack rather than having to allocate and initialize a tag list. A code sample from a program that creates a Boopsi string gadget might look like this: mystringgadget = (struct Gadget *)NewObject(NULL, "strgclass", GA_ID, 1L, GA_Left, 0L, GA_Top, 0L, STRINGA_LongVal, 100L, TAG_END); If newobject() is successful, it returns a pointer to a new boopsi gadget object. Otherwise, it returns NULL. The class "strgclass" is one of the public classes built into Release 2. It is a class of string gadgets. If you look at the diagram of the public classes built into Intuition, you'll see that strgclass is a subclass of gadgetclass. in the example above, the attribute tag IDs that start with "GA_" are defined by gadgetclass and not by strgclass. This is because strgclass inherits these attributes from its superclass, gadgetclass. The other attribute, stringa_longval, is defined by strgclass. it does two things. first, it tells the object that it is a special type of string gadget which only handles an integer value rather than a generic ASCII string. Second, it passes the object its initial integer value.