need help with pw_copy

Dean Grover ird grover at argon.hac.com
Thu Mar 9 17:24:14 AEST 1989


I have been trying to get the pixwin function pw_copy to work for some
time now.  I can't seem to get it to work.  Are there any known bugs with
it ?  I have included a sample program which shows what I am trying to do.
I want the pixwin from main_frame copied into the pixwin in main_frame2.
On all the machines I have tried, the main_frame2 pixwin remains blank.
(Sun 3 - OS 3.4,3.5,4.0.  Sun 4 - OS 4.0)

Thanks in advance.
Dean Grover
Hughes Aircraft Co.
adgrover at hac2arpa.hac.com

--- cut here

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

main(argc,argv)
int argc;
char *argv[];
{
int status;
Frame main_frame,main_frame2;
Canvas canvas1,canvas2;
Pixwin *pw1,*pw2;

    main_frame = window_create (NULL,FRAME,
		WIN_Y, 0,
		WIN_X, 0,
		FRAME_LABEL, "Frame 1",
		0);

    main_frame2 = window_create (NULL,FRAME,
		WIN_Y, 0,
		WIN_X, 300,
		FRAME_LABEL, "Frame 2",
		0);

    canvas1 = window_create (main_frame, CANVAS,
		WIN_WIDTH, 100,
		WIN_HEIGHT, 100,
		CANVAS_RETAINED, FALSE,
		0);

    canvas2 = window_create (main_frame2, CANVAS,
		WIN_WIDTH, 100,
		WIN_HEIGHT, 100,
		CANVAS_RETAINED, FALSE,
		0);

    pw1 = canvas_pixwin(canvas1);
    pw2 = canvas_pixwin(canvas2);



    window_fit(main_frame);
    window_fit(main_frame2);

    window_set(main_frame, WIN_SHOW, TRUE, 0);
    window_set(main_frame2, WIN_SHOW, TRUE, 0);

    (void) notify_dispatch();
    pw_vector(pw1,0,0,100,100,PIX_SRC,1);
    pw_vector(pw1,0,100,100,0,PIX_SRC,1);
    pw_copy(pw2,0,0,100,100,PIX_SRC,pw1,0,0);
    while (1) {
	(void) notify_dispatch();
	status =pw_copy(pw2,0,0,100,100,PIX_SRC,pw1,0,0);
	printf("pw_copy status %d\n",status);
    }
}



More information about the Comp.sys.sun mailing list