This chapter is a tutorial of the EZ widget library.
There are two classes of widgets in the EZ widget library: a class of simple widgets each of which is implemented using exactly one X window; and a class of composite widgets which are made from a group of simple widgets. Label, frame, buttons, menu-items, entry and sliders are examples of simple widgets while text widget, list box, notebook and notebook-page are composite widgets.
EZ widgets are event-driven. Interaction between an application and the EZ widget library is achieved via callbacks and event handlers. Typically, an EZwgl application contains five components: initialization, creating and configuring widgets, registering widget callbacks and/or event handlers, mapping widgets and handling events.
For some applications, especially interactive graphical applications,
it may be desirable to use a "polling" style programming.
The EZ widget library also provides an event "polling" routine,
EZ_ServiceEvents()
, which does no-waiting event processing.
The EZ widget library supports application resources. Appearance of an EZwgl application is completely configurable by resource files.
The EZ widget library implements a simple geometry manager (rectangle packer). The size and location of EZ widgets are computed semi-automatically by the geometry manager, in the sense that applications specify some controlling information about how to arrange a set of widgets, the geometry manager assigns a size and location to each widget.
The EZwgl also supports a more advanced grid bag geometry management.
There are some subtle differences between simple widgets and
composite widgets.
EZ_KEY_PRESS
event to a text
widget, nothing will happen because the frame window ignores key
events. To really send a key event to a text widget, one has to
extract the internal-text-widget component and send the event to
it.