main(int ac, char **av) { int i; EZ_Widget *frame, *led, *led1; EZ_Initialize(ac,av,0); colorArray = (unsigned long *)malloc(2000 * sizeof(unsigned long)); onoffArray = (char *)malloc(2000 * sizeof(char)); for(i=0; i < 20; i++) colors[i] = EZ_AllocateColorFromRGB(255, 10 * i, 0); frame = EZ_CreateWidget(EZ_WIDGET_FRAME, NULL, EZ_LABEL_STRING, "Led ...", EZ_FILL_MODE, EZ_FILL_BOTH, EZ_ORIENTATION, EZ_VERTICAL, EZ_BG_IMAGE_FILE, "bg1.gif", 0); led = EZ_CreateWidget(EZ_WIDGET_LED, frame, EZ_LED_WIDTH, 30, EZ_LED_HEIGHT, 20, EZ_BORDER_WIDTH, 2, EZ_BORDER_TYPE, EZ_BORDER_EMBOSSED, EZ_LABEL_POSITION, EZ_CENTER, EZ_LED_COLOR_FUNCTION, pickColor, 0); EZ_DisplayWidget(frame); EZ_CreateTimer(0, 50000, -1, rtimer_callback, led, 0); EZ_EventMainLoop(); }
/* * start animation */ void startAnimation(EZ_Widget *widget, long sec, long usec, int repeat) { if(widget && isAnimationWidget(widget)) { EZ_UnknownDataType d; d.p = (void *) EZ_CreateTimer(sec, usec, -1, animationTimerCallback, widget, repeat); EZ_SetWidgetUnknownData(widget,TIMER, d); } }
main(int ac, char **av) { int i; EZ_Widget *ezclock; EZ_Timer *timer; EZ_Initialize(ac,av,0); ezclock= EZ_CreateWidget(EZ_WIDGET_LCD, NULL, EZ_LCD_NDIGITS, 5, EZ_LCD_FONT_SIZE, 30, 0); for(i = 1; i < ac; ) { if(!strcmp(av[i], "-bg")) { if(i+1 < ac) EZ_ConfigureWidget(ezclock, EZ_LCD_BACKGROUND, av[(++i)], 0);} if(!strcmp(av[i], "-fg")) { if(i+1 < ac) EZ_ConfigureWidget(ezclock, EZ_LCD_FOREGROUND, av[(++i)], 0); } i++; } EZ_DisplayWidget(ezclock); timer = EZ_CreateTimer(0, 200000, -1, timer_callback, ezclock, 0); EZ_EventMainLoop(); }
main(int ac, char **av) { EZ_Widget *frame, *hgram; EZ_Initialize(ac, av, 0); frame = EZ_CreateWidget(EZ_WIDGET_FRAME, NULL, EZ_FILL_MODE, EZ_FILL_BOTH, EZ_ORIENTATION, EZ_VERTICAL, EZ_PADX, 0, EZ_PADY, 0, 0); hgram = EZ_CreateWidget(EZ_WIDGET_HISTOGRAM, frame, EZ_BORDER_WIDTH, 2, EZ_BAR_COLOR_N, 0, "green", EZ_BAR_COLOR_N, 1, "yellow", EZ_BAR_ORIENTATION, EZ_HORIZONTAL, EZ_IPADY, 2, EZ_IPADX, 2, 0); EZ_SetHistogramValues(hgram, values, 3); EZ_DisplayWidget(frame); EZ_CreateTimer(0, 100000, -1, timer_callback, hgram, 0); EZ_EventMainLoop(); }
static int initgui(void) { int i; EZ_Widget *tmp; topw=EZ_CreateFrame(0,0); EZ_ConfigureWidget(topw,EZ_PADY,0,EZ_ORIENTATION,EZ_VERTICAL_TOP,EZ_SIDE,EZ_LEFT,0); upframew=EZ_CreateFrame(topw,0); EZ_ConfigureWidget(topw,EZ_IPADX,6,0); bbsnamew=EZ_CreateLabel(upframew,maincfg.CFG_BOARDNAME); EZ_ConfigureWidget(bbsnamew,EZ_BORDER_TYPE,EZ_BORDER_RIDGE,EZ_BORDER_WIDTH,1,EZ_WIDTH,500,0); sizecw=EZ_CreateCheckButton(upframew,"Show buttons",0,1,0,1); nodelistw=EZ_CreateListBox(topw,0,1); EZ_ConfigureWidget(nodelistw,EZ_HEIGHT,5+16*nlines,EZ_WIDTH,640,EZ_FONT_NAME,"-misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-1",0); EZ_SetWidgetCallBack(nodelistw,listsel,0); botw=EZ_CreateFrame(topw,0); EZ_ConfigureWidget(botw,EZ_SIDE,EZ_LEFT,0); cmd1w=EZ_CreateFrame(botw,0); EZ_ConfigureWidget(cmd1w,EZ_ORIENTATION,EZ_HORIZONTAL,EZ_SIDE,EZ_LEFT,EZ_PADY,1,0); cmd1lw=EZ_CreateFrame(cmd1w,0); openvieww=EZ_CreateButton(cmd1lw,"Open view",0); EZ_ConfigureWidget(openvieww,EZ_WIDTH,80,EZ_HEIGHT,25,EZ_X,0,EZ_Y,0,0); EZ_SetWidgetCallBack(openvieww,openview,0); closevieww=EZ_CreateButton(cmd1lw,"Close view",0); EZ_ConfigureWidget(closevieww,EZ_WIDTH,80,EZ_HEIGHT,25,EZ_X,81,EZ_Y,0,0); EZ_SetWidgetCallBack(closevieww,closeview,0); chatw=EZ_CreateButton(cmd1lw,"Chat",0); EZ_ConfigureWidget(chatw,EZ_WIDTH,80,EZ_HEIGHT,25,EZ_X,0,EZ_Y,26,0); EZ_SetWidgetCallBack(chatw,chat,0); kickw=EZ_CreateButton(cmd1lw,"Kick user",0); EZ_ConfigureWidget(kickw,EZ_WIDTH,80,EZ_HEIGHT,25,EZ_X,81,EZ_Y,26,0); EZ_SetWidgetCallBack(kickw,kick,0); editw=EZ_CreateButton(cmd1lw,"Edit user",0); EZ_ConfigureWidget(editw,EZ_WIDTH,80,EZ_HEIGHT,25,EZ_X,0,EZ_Y,52,0); EZ_SetWidgetCallBack(editw,edit,0); quitw=EZ_CreateButton(cmd1lw,"Quit",0); EZ_ConfigureWidget(quitw,EZ_WIDTH,80,EZ_HEIGHT,25,EZ_X,81,EZ_Y,52,0); EZ_SetWidgetCallBack(quitw,quit,0); for (i=0; i < 4 ; i++) { radiow[i]=EZ_CreateRadioButton(cmd1lw,viewnames[i],-1,0,i); EZ_ConfigureWidget(radiow[i],EZ_X,170+i*120,EZ_Y,1,0); EZ_SetWidgetCallBack(radiow[i],radiocall,0); } EZ_SetRadioButtonGroupVariableValue(tmp,0); infow=EZ_CreateListBox(cmd1lw,0,1); EZ_ConfigureWidget(infow,EZ_Y,30,EZ_X,170,EZ_WIDTH,440,EZ_HEIGHT,5+16*isize,EZ_FONT_NAME,"-misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-1",0); buildnodew(0); EZ_SetListBoxItems(infow,lulines,ilines); EZ_DisplayWidget(topw); EZ_CreateTimer(1,0,-1,mytimer,0,0); }