/* Y o u r   D e s c r i p t i o n                       */
/*                            AppBuilder Photon Code Lib */
/*                                         Version 2.03  */

/* Standard headers */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <photon/PxImage.h>
/* Local headers */
#include "ablibs.h"
#include "abimport.h"
#include "proto.h"
#include "Globals.h"
int
timer( PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t *cbinfo )

{
	PtArg_t arga[4];
	int eval;
	pos.x=pos.x+10;
	pos.y=25;
	printf("x= %d\n",pos.x);
	printf("y= %d\n",pos.y);
	widget = widget, apinfo = apinfo, cbinfo = cbinfo;
	my_image= PxLoadImage("/home/PSR.jpg",NULL);
	if ((eval = PtEnter(0)) < 0 && eval!= -EDEADLK)
	    							{
	    					fprintf( stderr, "Couldn't enter: %s\n",strerror( -eval ) );
	    							}
	    							else
	    							{
	    								    	PtSetArg( &arga[0],Pt_ARG_LABEL_TYPE,Pt_IMAGE,0);
	    								    	PtSetArg( &arga[1], Pt_ARG_LABEL_IMAGE, my_image, 0 );
	    								    	PtSetArg( &arga[2], Pt_ARG_POS, &pos, 0);
	    								    	my_label[a]=PtCreateWidget(PtLabel,NULL,3,arga);
	    								        PtRealizeWidget(my_label[a]);
	    								        PtFlush();
	    								        a = (3 < a) ? 0 : a+1 ;
	    								        printf("a= %d\n ",a);
	    								        if(a==4)
	    								        {
    								        	PtUnrealizeWidget(my_label[a-4]);
    								        	PtUnrealizeWidget(my_label[a-3]);
	    								        PtUnrealizeWidget(my_label[a-2]);
	    								        PtUnrealizeWidget(my_label[a-1]);
	    								        }
	    								        PtLeave(eval);
	    							}
return (Pt_CONTINUE);
	}
int
activate( PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t *cbinfo)
{
//	ApCreateModule(ABM_info_win,NULL,info);
	return Pt_CONTINUE ;
}
	/*	switch (i)
		{case 1:
			my_image= PxLoadImage("/home/PSR.jpg",NULL);
			PtSetArg( &argt[0],Pt_ARG_LABEL_TYPE,Pt_IMAGE,0);
			PtSetArg( &argt[1], Pt_ARG_LABEL_IMAGE, my_image, 0 );
			PtSetArg( &argt[2], Pt_ARG_POS, &pos, 0);
			my_label=PtCreateWidget(PtLabel,NULL,3,argt);
			PtRealizeWidget(my_label);
			PtSetArg (&args[0], Pt_ARG_AREA, &cir_area, 0);
			PtSetArg (&args[1], Pt_ARG_COLOR, Pg_GREEN, 0);
			PtSetArg (&args[2], Pt_ARG_FILL_COLOR, Pg_GREEN, 0);
			my_elipse=PtCreateWidget (PtEllipse, NULL, 3, args);
			PtRealizeWidget(my_elipse);
			PtUnrealizeWidget(my_label);
			PtFlush();
		 break;
		 case 2:
			my_image= PxLoadImage("/home/SSR.jpg",NULL);
			PtSetArg( &argt[0],Pt_ARG_LABEL_TYPE,Pt_IMAGE,0);
			PtSetArg( &argt[1], Pt_ARG_LABEL_IMAGE, my_image, 0 );
			PtSetArg( &argt[2], Pt_ARG_POS, &pos, 0);
			my_label=PtCreateWidget(PtLabel,NULL,3,argt);
			PtRealizeWidget(my_label);
			PtSetArg (&args[0], Pt_ARG_AREA, &cir_area, 0);
			PtSetArg (&args[1], Pt_ARG_COLOR, Pg_RED, 0);
			PtSetArg (&args[2], Pt_ARG_FILL_COLOR, Pg_RED, 0);
			my_elipse=PtCreateWidget (PtEllipse, NULL, 3, args);
			PtRealizeWidget(my_elipse);
			PtUnrealizeWidget(my_label);
			PtFlush();
		break;
		 default:
			 my_image= PxLoadImage("/home/PSRSSR.jpg",NULL);
			 PtSetArg( &argt[0],Pt_ARG_LABEL_TYPE,Pt_IMAGE,0);
			 PtSetArg( &argt[1], Pt_ARG_LABEL_IMAGE, my_image, 0 );
			 PtSetArg( &argt[2], Pt_ARG_POS, &pos, 0);
			 my_label=PtCreateWidget(PtLabel,NULL,3,argt);
			 PtRealizeWidget(my_label);
			 PtSetArg (&args[0], Pt_ARG_AREA, &cir_area, 0);
			 PtSetArg (&args[1], Pt_ARG_COLOR, Pg_BLUE, 0);
			 PtSetArg (&args[2], Pt_ARG_FILL_COLOR, Pg_BLUE, 0);
			 my_elipse=PtCreateWidget (PtEllipse, NULL, 3, args);
			 PtRealizeWidget(my_elipse);
			 PtUnrealizeWidget(my_label);
			 PtFlush();
			 break;
		}*/

