TOC PREV NEXT INDEX

GDcreate_instance

Synopsis

create an instance from a given template name

OMobj_id _ GDcreate_instance (
OMobj_id _ parent_id ,
char _* class_name ,
char _* instance_name _);

Description

GDcreate_instance creates an instance given a template name.

Parameters

parent_id

The id of the new instance's parent object. The new object becomes an immediate subobject parent_id .
You can specify NULL. The new object becomes an immediate subobject of Applications, Default Applications, ModuleStack, or ScratchPad.

class_name

The name of the new object's class object, such as DefaultView.

instance_name

A name for the new instance.

Returned Value

The object id of the new object; NULL if GDcreate_instance failed.

Example

/* Create a camera called mycamera. Its parent is app1_id.
__Its template is DefaultCamera. */
OMobj_id _app1_id; /* Assume this has been set. */
OMobj_id _mycamera_id;
...
mycamera_id = GDcreate_instance(app1_id, "DefaultCamera",
"mycamera");
if (OMis_null_elem(mycamera_id))
printf("Error creating camera\n");


TOC PREV NEXT INDEX