main(int argc, char **argv) { EZ_Widget *menu, *button, *tmp; EZ_Initialize(argc, argv, 0); button = EZ_CreateButton(NULL,"An Optional Button", -1); /* a button */ menu = EZ_CreatePopupMenu(NULL); EZ_ConfigureWidget(button, EZ_EVENT_HANDLER, buttonEventHandler, EZ_CLIENT_PTR_DATA, menu, 0); EZ_ConfigureWidget(menu, EZ_CALLBACK, menuCallBack, EZ_CLIENT_PTR_DATA, button, 0); { char **ptr = colors; int i = 0; while(*ptr) { tmp = EZ_CreateMenuNormalButton(menu, *ptr, -1, i++); ptr++; } } EZ_DisplayWidget(button); EZ_EventMainLoop(); }
main(int ac, char **av) { EZ_Widget *frame, *tmp, *btn; int i; EZ_Initialize(ac,av,0); MY_BG_ATOM = EZ_GetAtom("MY_BG_ATOM"); frame = EZ_CreateFrame(NULL, "Drag sources"); tmp = EZ_CreateFrame(frame, NULL); EZ_ConfigureWidget(tmp, EZ_ORIENTATION, EZ_VERTICAL, EZ_FILL_MODE, EZ_FILL_BOTH, 0); for(i = 0; i < 8; i++) { btn = EZ_CreateButton(tmp, colors[i], -1); EZ_ConfigureWidget(btn, EZ_EXPAND, True, EZ_BACKGROUND, colors[i], 0); EZ_WidgetAddDnDDataEncoder(btn, MY_BG_ATOM, 0, encodeBG, NULL, NULL, NULL); } EZ_DisplayWidget(frame); EZ_EventMainLoop(); }
/*------------------ Initialize_Info_Widget() ----------------------*/ void Initialize_Info_Widget() { EZ_Widget *tmp_w1, *tmp_w2; /* create and configure the information display widget */ Info_Widget = EZ_CreateFrame(NULL, fname); EZ_ConfigureWidget(Info_Widget, EZ_PADX, 0, EZ_PADY, 0, EZ_STACKING, EZ_VERTICAL, EZ_WIDTH, 650, EZ_HEIGHT, 500, EZ_FILL_MODE, EZ_FILL_BOTH, 0); tmp_w1 = EZ_CreateFrame(Info_Widget, NULL); EZ_ConfigureWidget(tmp_w1, EZ_PADX, 8, EZ_PADY, 0, EZ_EXPAND, True, EZ_HEIGHT, 0, EZ_STACKING, EZ_HORIZONTAL_LEFT, 0); Info_Close_Button = EZ_CreateButton(tmp_w1,"Close",-1); /* create a widget for the actual mincheader text */ tmp_w2 = EZ_CreateFrame(Info_Widget, NULL); EZ_ConfigureWidget(tmp_w2, EZ_FILL_MODE, EZ_FILL_BOTH, 0); Mincheader_Widget = EZ_CreateTextWidget(tmp_w2,0,1,1); /* add the callback for shutdown of the info widget */ EZ_AddWidgetCallBack(Info_Close_Button, EZ_CALLBACK, Close_Info_Widget, NULL,0); /* set WM hints for user placement */ EZ_SetWMHintsAndSizeHints(File_Save_Widget, 0); }
main(int ac, char **av) { EZ_Item *item; EZ_Widget *tree, *btn; EZ_TreeNode *root, *node1, *node2, *node11, *tmp; EZ_TextProperty *p1, *p2, *p3; EZ_Initialize(ac, av, 0); tree = EZ_CreateWidget(EZ_WIDGET_LIST_TREE, NULL, EZ_WIDTH_HINT, 400, EZ_HEIGHT_HINT, 400, EZ_IPADY, 2, EZ_ROW_BG, 1, "white", "bisque", EZ_SELECTION_BACKGROUND, "green3", 0); EZ_ConfigureWidget(tree, EZ_CALLBACK, callback, tree, NULL); p1 = EZ_GetTextProperty(EZ_PIXMAP_FILE, "question.xpm", EZ_FOREGROUND, "red", EZ_FONT_NAME, "-Adobe-Helvetica-Medium-R-Normal--*-180-*-*-*-*-*-*", 0); p2 = EZ_GetTextProperty(EZ_PIXMAP_FILE, "folder.xpm", EZ_FOREGROUND, "blue", 0); p3 = EZ_GetTextProperty(EZ_PIXMAP_FILE, "file.xpm", EZ_FOREGROUND, "yellow", 0); /* the root node */ item = EZ_CreateLabelItem("root", p1); Root = root = EZ_CreateTreeNode(NULL, item); /* children */ item = EZ_CreateLabelItem("child 1", p2); node1 = EZ_CreateTreeNode(root, item); item = EZ_CreateLabelItem("child 2", p2); node2 = EZ_CreateTreeNode(root, item); /* grand children */ item = EZ_CreateLabelItem("grandchild 11", p3); node11 = EZ_CreateTreeNode(node1, item); item = EZ_CreateLabelItem("grandchild 12", p3); tmp = EZ_CreateTreeNode(node1, item); item = EZ_CreateLabelItem("grandchild 21", p3); tmp = EZ_CreateTreeNode(node2, item); /* grand grand children */ item = EZ_CreateLabelItem("gg child 111", p2); tmp = EZ_CreateTreeNode(node11, item); btn = EZ_CreateButton(NULL, "A Widget", 0); /* EZ_AddWidgetCallBack(btn, EZ_CALLBACK, resettree, root, 0);*/ item = EZ_CreateWidgetItem(btn); EZ_AddWidgetCallBack(btn, EZ_CALLBACK, wcallback, item, 0); node11 = EZ_CreateTreeNode(node11, item); item = EZ_CreateLabelItem("child of widget item", p2); node11 = EZ_CreateTreeNode(node11, item); item = EZ_CreateLabelItem("test node 1", p2); node11 = EZ_CreateTreeNode(node11, item); item = EZ_CreateLabelItem("test node 2", p2); node11 = EZ_CreateTreeNode(node11, item); item = EZ_CreateLabelItem("test node 3", p2); node11 = EZ_CreateTreeNode(node11, item); item = EZ_CreateLabelItem("test node 4", p2); node11 = EZ_CreateTreeNode(node11, item); item = EZ_CreateLabelItem("test node 5", p2); tmp = node11 = EZ_CreateTreeNode(node11, item); { unsigned long gcmask; XGCValues gcvalues; unsigned long red, green, blue, yellow, cyan, magenta; GC gc; gcvalues.foreground = red; gc = EZ_GetGC( GCForeground, &gcvalues); item = EZ_CreateItem(EZ_FIG_ITEM, NULL); /*EZ_FigItemAddRectangle(item, gc, 0,0,90, 80);*/ gcvalues.foreground = green; gc = EZ_GetGC( GCForeground, &gcvalues); EZ_FigItemAddFilledArc(item, gc, 0, 0, 50, 50, 0, 300*64); /* item = EZ_CreateLabelItem("test node 6", p2);*/ node11 = EZ_CreateTreeNode(node11, item); } EZ_SetListTreeWidgetTree(tree, root); EZ_ListTreeWidgetSelectNode(tree, tmp, NULL); EZ_TreeSetCharacter(root, EZ_BRANCHED_LIST_TREE, 20, 2, 2); EZ_DisplayWidget(tree); 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); }