Download

Support

The Object Model

The basis for all widgets in Ewl is Ewl_Object. Ewl_Objects are never allocated outside of another widget, it provides size and position information for the widget as well as info about the widgets padding and insets. There are also fields for indicating object alignment and fill policies.

The next step above Ewl_Object is Ewl_Widget. Again, Ewl_Widgets are usually not allocated by themselves, but are part of all the other widgets available in Ewl. The Ewl_Widget class provides the necessary information about a widget that relates to its appearance, its parent container, event handling, as well as a few miscellaneous tasks common to all widgets. The Ewl_Widget structure also contains information on the inheritance of any given widget. This is useful if you need to check the type of a widget in your code.

A necessary class that some widgets inherit from is Ewl_Container. This is used for holding collections of widgets and specifiying their layout. Containers are the building blocks of the widget set. They allow for creating heirarchies of widgets that are bounded within their parent containers. Ewl_Container inherits from Ewl_Widget, so any container can also be treated as a widget, and thus you can put containers within other containers. Examples of inheriting classes are Ewl_Window and Ewl_Box. In the case of Ewl_Window, widgets inside the window are given any position they request within the insets of the window. For Ewl_Box, contained widgets are layed out either from top to bottom, or from left to right, depending on the box orientation.


Copyright © Enlightenment.org

Enlightened Widget Library Documentation Generated: Sun Sep 27 01:49:46 2009