Fill Policies
As widgets are packed together their fill policies kick in and adjust the widget sizes as needed to make everything fit. The fill policies of Ewl can be a bit confusing for the first time user, hell, I still have problems at times.Using the fill policy
The basis for how fill policies fit together is shown the following image.

There are three sizes to any widget:
- minimum size
- preferred size
- maximum size
As the name implies the widget wants to be set to its preferred size whenever possible. If the fill policy allows, the widget can also shrink or grow within the bounds of its minimum and maximum sizes.
Fill Policy | Effect ---------------------------------------------------------------- EWL_FLAG_FILL_NONE | Do not fill or shrink in any direction EWL_FLAG_FILL_VSHRINK | Vertically shrink EWL_FLAG_FILL_HSHRINK | Horizontally shrink EWL_FLAG_FILL_SHRINK | Shrink both horizontally and vertically EWL_FLAG_FILL_VFILL | Vertically fill EWL_FLAG_FILL_HFILL | Horizontally fill EWL_FLAG_FILL_FILL | Fill both horizontally and vertically EWL_FLAG_FILL_ALL | Shrink or fill as needed
Guidelines for container authors
As you have seen in the previous section fill policies and the three different sizes are very closely connected. As a container author you have to set them to proper values in particular for the preferred size. Of course you do not have to overwrite them if you are inheriting this feature from the parent widget, as long it fits your needs.
- Note:
- The following guidelines are only commendations and not strict rules. There maybe good reason for some containers to not follow them.