wn_switch_create_c

	status.i4.v = wn_switch_create_c(window_id.i4.v, switch_type.i4.v,
					 x_left.r4.v, y_lower.r4.v,
					 width.r4.v, height.r4.v,
					 text.i1a.r, switch_id.i4.r,
					 coordinate_type.i4.v [,state.i4.v]
					 [,color.i4.v] [,on_func.f.v]
					 [,on_func_data.g.v] [,off_func.f.v]
					 [,off_func_data.g.v])

	This routine will create a switch region in a graphics window.

	window_id	window ID (use WN_BACKGROUND for background window)
	switch_type	type of switch
			(SWITCH_LATCH -> latching switch,
			 SWITCH_MOMENTARY -> momentary switch)
	x_left, y_lower	window coordinates of the lower left hand
			corner of the switch (A value of WN_CENTER_IT for
			either coordinate will center the switch in the
			window for that plane.)
	width		width of switch region
	height		height of switch region
	text		null terminated switch text  (Note: For switches
			which should not be displayed, pass a null string
			or a null pointer.)
	switch_id	returned switch ID
			(A value of NULL can be passed for this argument
			 if the switch ID is not needed.)
	coordinate_type	type of coordinate values passed
			(WN_WORLD_COORDS -> normal window world coordinates,
			 WN_PIXEL_COORDS -> raw pixel coordinates)
	[state]		initial state of the switch (only used for latching
			switches)
			(SWITCH_ON -> on,
			 SWITCH_OFF -> off (default))
	[color]		switch color (default is WHITE)
			(constants are in 'cnsparam')
	[on_func]	address of function to be called when the switch
			is pressed (default is NULL)
			(called as follows:
			 on_func(wid.i4.v, func_data.g.v, switch_data.s.r)
			 ("switch_data" is a structure of type
			  SWITCH_ACTION_DATA))
	[on_func_data]	address of data to be passed to "on_func"
			(default is NULL)
	[off_func]	address of function to be called when the switch
			is turned off (latching switches only) (default is NULL)
			(called as follows:
			 off_func(wid.i4.v, off_func_data.g.v, switch_data.s.r)
			 ("switch_data" is a structure of type
			  SWITCH_ACTION_DATA))
	[off_func_data]	address of data to be passed to "off_func"
			(default is NULL)

	This function returns ACNET status values as follows:

	OK			success
	CBS_INVARG		invalid width or height
	CBS_INVSIZ		switch is too small for selected font
	CBS_INVID		window doesn't exist
	CBS_NOT_IN_WINDOW	switch is not entirely in the requested window
	CBS_MEMFAIL		failed in allocating dynamic memory

	This function requires the following include files:

	cnsparam_h, cns_data_structs_h, cbslib_h, acnet_errors_h, cns_data_structs_h

	Related functions:

	wn_switch_delete_c, wn_switch_read_c, wn_switch_pressed,
	wn_switch_window_delete_c, wn_window_has_switch_c,
	wn_switch_set_state_c, wn_switch_disable_c, wn_switch_enable_c,
	wn_switch_relabel_c, wn_switch_redraw_c, switch_create_c

	C/C++ usage:

	static const char	text[] = "Switch";
	int	status;
	int	window_id;
	int	switch_id;
	int	switch_type = SWITCH_LATCH;
	int	coordinate_type = WN_WORLD_COORDS;
	int	state = SWITCH_OFF;
	int	color = WHITE;
	float	x_left = WN_CENTER_IT;
	float	y_lower = WN_CENTER_IT;
	float	width = 10.0;
	float	height = 3.0;
	void	on_func(int window_id, void *dummy,
			SWITCH_ACTION_DATA *switch_data);
	void	off_func(int window_id, void *dummy,
			 SWITCH_ACTION_DATA *switch_data);
	void	*on_func_data = (void *) NULL;
	void	*off_func_data = (void *) NULL;

	status = wn_switch_create_c(window_id,switch_type,x_left,y_lower,
				    width,height,text,&switch_id,
				    coordinate_type,state,color,on_func,
				    on_func_data,off_func,off_func_data);