🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.sun
Article #8278

sunview programming question (border on frame)

#8278
From: Bruce Allen
Date: Tue, 04 Jun 1991 18:40
49 lines
1810 bytes
I am writing some short sunview code segments to display a rasterfile in a
640x480 window.  I create a base frame then a canvas inside it.  Then I draw
into the canvas. 

My problem: the frame has a border which is 5 pixels wide on each side.  I
would like to narrow this border to either 0 or 1 pixel.  How can I do this?

The two relevant functions:

void openwindow()
{
	frame=window_create(NULL,FRAME,
		WIN_ERROR_MSG,"Can't create window",
		FRAME_SHOW_LABEL,FALSE,
		WIN_WIDTH,650,	/* NOTE: allows extra 5 pixel border */
		WIN_HEIGHT,490, /* NOTE: allows extra 5 pixel border */
		0);

	canvas=window_create(frame,CANVAS,
		CANVAS_WIDTH,640,
		CANVAS_HEIGHT,480,
		0);
	cursor=window_get(canvas,WIN_CURSOR);
	cursor_set(cursor,CURSOR_OP,PIX_DST,0);
	window_set(canvas,WIN_CURSOR,cursor,0);
	pw=(Pixwin *)canvas_pixwin(canvas);
}

displayit(fpointer)
FILE *fpointer;
{
	Pixrect *pr;
	colormap_t cm;

	pr=pr_load(fpointer,&cm);
	if (pr==NULL) {
		perror("Unable to read in rasterfile!");
		abort();
	}
	pw_setcmsname(pw,"grayscales");
	pw_batch_on(pw); 
	pw_putcolormap(pw,0,cm.length,cm.map[0],cm.map[1],cm.map[2]);
	pw_write(pw,0,0,640,480,PIX_SRC,pr,0,0);
	pw_batch_off(pw); 
	window_set(frame,WIN_SHOW,TRUE,0); 
	notify_dispatch();
	pr_destroy(pr);
	sleep(1);
}
Technical Details
Message-ID: <3416@brchh104.bnr.ca>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!cunews!bnrgate!brchh104!brchs1!bnr.ca!rice.edu!sun-spots-request

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!cunews!bnrgate!brchh104!brchs1!bnr.ca!rice.edu!sun-spots-request
From: ballen@convex.csd.uwm.edu (Bruce Allen)
Newsgroups: comp.sys.sun
Subject: sunview programming question (border on frame)
Keywords: No Digest Subjects in Unmoderated Mode
Message-ID: <3416@brchh104.bnr.ca>
Date: 4 Jun 91 18:40:00 GMT
Sender: news@brchh104.bnr.ca
Organization: Sunspots, Psuedo-Unmoderated
Lines: 50
Approved: sun-spots@rice.edu
X-Original-Date:    21 May 91 17:03:47 GMT