return to first page linux journal archive
keywordscontents

Listing 1. sample.c XView Program

/*
 *	Sample XView Program
 *	- creates window frame
 *	- adds text subwindow
 */
#include	<xview/xview.h>
#include	<xview/textsw.h>

void main(int argc, char *argv[])
{
	Frame	frame;
	/* let XView scan command-line arguments */
	xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, &argv,
		NULL);
	/* make a top-level container */
	frame = (Frame)xv_create(XV_NULL, FRAME,
			FRAME_LABEL,	argv[0],
			NULL);
	/* add a text-subwindow to the frame */
	(void)xv_create(frame, TEXTSW, NULL);

	/* let XView handle all X events for us */
	xv_main_loop(frame);
	exit(0);
	}