SunView 4.x bug?

csvsj at garnet.Berkeley.EDU csvsj at garnet.Berkeley.EDU
Thu Dec 21 09:40:43 AEST 1989


The following program behaves differently in 4.x SunView than it did in
3.x Sunview:

#include <stdio.h>
#include <suntool/sunview.h>
#include <suntool/canvas.h>
#include <suntool/panel.h>

Canvas	canvas;
void done_proc();

main()
{
	Frame	frame;
	Panel panel;

    frame = window_create(NULL, FRAME,
				0);
	canvas = window_create(frame, CANVAS,
				WIN_HEIGHT,	102,
				WIN_WIDTH,	102,
				CANVAS_WIDTH,	102,
				CANVAS_HEIGHT,	102,
				0);
	panel = window_create(frame, PANEL, 0);
	panel_create_item(panel, PANEL_BUTTON, 
				PANEL_LABEL_STRING, "EXIT",
				PANEL_NOTIFY_PROC, done_proc, 0);
	window_fit(panel);
	window_fit(frame);
	window_main_loop(frame);
}

void
done_proc(item, event)
Panel_item item;
Event *event;
{
	Pixwin	*pw;
	Pixrect *pr;
	struct mpr_data *d;

	pw = canvas_pixwin(canvas);
	pr = pw->pw_prretained;
	d = mpr_d(pr);
	printf("width = %d linebytes = %d\n", pr->pr_size.x, d->md_linebytes);
	exit();
}


Under SunView 4.x, the program outputs "width = 102 linebytes = 16" when
the "EXIT" button is selected.  Under SunView 3.x, the program outputs
"width = 102 linebytes = 14".

Apparently, under SunView 4.x, the pixrect data for the canvas pixwin's
retained pixrect is padded to a 32 bit boundary for each row, rather than
a 16 bit boundary.

The documentation in the Pixrect Reference Manual says that data for
memory pixrect rows are rounded up to 16-bit boundaries.

So is this behavior a bug, or what?



More information about the Comp.sys.sun mailing list