DragonFly On-Line Manual Pages

Search: Section:  

EZ(3)                           EZWGL Functions                          EZ(3)


EZ - introduction to EZWGL, the EZ widget and graphics library


The EZ widget and graphics library (EZWGL) is a C library written on top of Xlib. It is designed for developing graphics user interface under the X window system programming environment.


EZWGL consists of two parts, a widget library and a graphics library. The widget library implements about a twenty or so commonly used widgets, including button, label, frame, entry, text-widget, listbox, slider, notebook, combox, menu, file-selector, list-tree, work-area, spin-button, gradient-bar, histogram, spread-sheet and 3D-canvas. The widget library also implements a drag-and-drop mechanism and a resource management scheme. The graphics library implements about 100 OpenGL(TM) like graphics functions that provides high level support for 3D graphics, including features like zbuffer, double-buffer and lighting. An EZWGL application consists of following components. 1. Include the one and only header file "EZ.h" 2. Initialize the library by calling EZ_Initialize 3. Create widgets using EZ_CreateWidget 4. Register widget callbacks and event handlers using EZ_AddWidgetCallBack and EZ_AddEventHandler 5. Map widgets by invoking EZ_DisplayWidget on your toplevel widgets 6. Processing events using EZ_EventMainLoop or EZ_ServiceEvents or EZ_WaitAndServiceNextEvent Here is a simple example that demonstrates these steps. #include "EZ.h" /* the header file */ static void doexit(EZ_Widget *w, void *d) { EZ_Shutdown(); exit(0); } main(int argc, char **argv) { EZ_Widget *hello; EZ_Initialize(argc,argv,0); /* initialize EZWGL */ /* create a button and set its foreground red */ hello = EZ_CreateWidget(EZ_WIDGET_NORMAL_BUTTON, NULL, EZ_LABEL_STRING, "Hello World", EZ_FOREGROUND, "red", 0); EZ_AddWidgetCallBack(hello, /* register call back */ EZ_CALLBACK, doexit, NULL, 0); EZ_DisplayWidget(hello); /* show the button */ EZ_EventMainLoop(); /* handle mouse inputs */ }


EZ_Initialize(3), EZ_CreateWidget(3), EZ_DisplayWidget(3), EZ_Shutdown(3) EZWGL EZ(3)

Search: Section: