
#include "EZ.h"                               /* the header file      */
#include <math.h>
  
main(int argc, char **argv)
{
  EZ_Widget *frame, *label, *tmp, *tmpA;
  int count;
  float dtx = 0.019654873;
  float dty = 0.032143435;

  EZ_Initialize(argc,argv,0);                  /* initialize EZWGL    */
  frame = EZ_CreateFrame(NULL, NULL);
  EZ_ConfigureWidget(frame, EZ_WIDTH, 600, EZ_HEIGHT, 600, 0);

  label = EZ_CreateFreeLabel(frame,"fish"); 
  EZ_ConfigureWidget(label,  EZ_PIXMAP_FILE, "fish1.xpm",
		     EZ_PROPAGATE, 0,
		     EZ_TRANSIENT, 1,
		     0);

  for(count = 0; count < 14; count++)
    {
      char str[16];
      int j;
      tmp = EZ_CreateFrame(frame, NULL);
      EZ_ConfigureWidget(tmp, EZ_ORIENTATION, EZ_VERTICAL,
			 EZ_PADX,0,EZ_PADY,0, EZ_IPADX,0,EZ_IPADY,0,
			 EZ_FILL_MODE, EZ_FILL_BOTH,0);      
      for(j = 0; j < 15; j++)
	{
	  sprintf(str, "%d%d", count, j);
	  (void) EZ_CreateButton(tmp, str,-1);
	}
    }

  EZ_DisplayWidget(frame);

  while(1)
    {
      int x, y, d;
      count++;
      d = count % 10;

      x = (int) (280.0 * sin( dtx * count) + 270.0);
      y = (int) (280.0 * sin( dty * count) + 270.0);
      if(d == 0)
	EZ_ConfigureWidget(label,
			   EZ_PIXMAP_FILE, "fish1.xpm",
			   EZ_X, x, EZ_Y, y,
			   0);
      else if(d == 5)
	EZ_ConfigureWidget(label,
			   EZ_PIXMAP_FILE, "fish2.xpm",
			   EZ_X, x, EZ_Y, y,
			   0);
      EZ_ServiceEvents();
      EZ_SitForALittleBit(1000);
    }
}
/************************** Example 1 *********************************/

