NhlCreate

The Fortran name of this function is NhlFCreate.

This function is used to create an instance of any HLU object. It is provided as an access function to objects that are Base class.


C synopsis

#include <ncarg/hlu/hlu.h>
#include <hfile for class being created>

NhlErrorTypes NhlCreate(
		int		*ret_id,
		NhlString	name,
		NhlClass	lc,
		int		parent_id,
		int		rlist_id
		)

Fortran synopsis

      external function_for_class_being_created
      subroutine NhlFCreate(ret_id, name, lc, parent_id, rlist_id, ierr)
      integer ret_id, parent_id, rlist_id, ierr
      character*(*) name
      external lc

Arguments

ret_id (output)
Returns the object id that is used to identify the created object. HLU object ids are always positive numbers. If this function is unable to create the object, this value will be set to the return value of the function (NhlFATAL).
name (input)
Sets the name of the object being created.
lc (input)
Identifies the class of object to create, i.e. the type of object to create.
parent_id (input)
Id of the object that should be the parent of the object being created. The constant NhlDEFAULT_APP (0) can be used to indicate the current default parent App object.
rlist_id (input)
Id of a ResList that specifies which resources to initialize, and what values to initialize them to. A value of 0 can be used to indicate a NULL ResList. The ResList should be created with a list_type of NhlSETRL (or 'setrl' in Fortran).
ierr (output, Fortran only)
Error code.

Types

Type name:		NhlTErrorTypes
Definition:
typedef enum _NhlErrType{
	NhlFATAL	= -4,	/* "FATAL"	*/
	NhlWARNING	= -3,	/* "WARNING"	*/
	NhlINFO		= -2,	/* "INFO"	*/
	NhlNOERROR	= -1	/* "NOERROR"	*/
} NhlErrorTypes;

Description

This function is used to create any object in the HLU library. The NhlCreate function uses the ResList specified by the rlist_id parameter to initialize resources that you want to initialize differently than the default. The rlist_id is allocated using the NhlRLCreate function. You set the names and values to initialize using the NhlRLSet, NhlRLSetArray and NhlRLSetMDArray functions.

The parent_id argument should be set as follows:

  1. If you are creating an App object, this argument is ignored.
  2. If you are creating a Workstation or DataItem object, this argument should specify an App object.
  3. If you are creating a View object, this argument should specify a Workstation object.

The NhlCreate function uses the Resource Database to determine the default values to initialize resources to. The values set in the rlist_id ResList are used to override these default values. If defaults cannot be determined from the ResList, or from the resource database, then internal hard-coded defaults will be used.

The SetValues functions can be used to change the resource values of an object after it has been created.


Return values

The NhlCreate C function returns a value of type NhlErrorTypes, and the NhlFCreate Fortran subroutine returns the error in ierr. The following table indicates what the return error values mean:
Value	|			Meaning
--------+-------------------------------------------------
NOERROR	|	Object was created with no problems.
--------+-------------------------------------------------
INFO	|	Error was recoverable - usually indicates
	|	that the programmer passed an invalid
	|	resource name or value in the args
	|	argument that was ignored.
--------+-------------------------------------------------
WARNING	|	Error was recoverable - usually indicates
	|	that there may be some parts of the object
	|	that are not configured properly, and that
	|	a FATAL error may occur at a later time.
--------+-------------------------------------------------
FATAL	|	The function was unable to create the
	|	object.

See also


Copyright

Copyright 1987-1999 University Corporation for Atmospheric Research
The use of this Software is governed by a License Agreement.

NCAR Graphics is a registered trademark of the University Corporation for Atmospheric Research.

Reference Manual Control Panel

NG4.1 Home, Index, Examples, Glossary, Feedback, Ref Contents, Ref WhereAmI?


$Revision: 1.18 $ $Date: 1998/06/15 21:26:06 $