Package: gtk

Accessor gtk-widget-hexpand

Lambda List

gtk-widget-hexpand (object)


(gtk-widget-hexpand object) => expand
(setf (gtk-widget-hexpand object) expand)


object -- a gtk-widget object


Accessor of the slot hexpand of the gtk-widget class.

The generic function gtk-widget-hexpand gets whether the widget would like any available extra horizontal space.

When a user resizes a gtk-window, widgets with expand = true generally receive the extra space. For example, a list or scrollable area or document in your window would often be set to expand.

Containers should use the function gtk-widget-compute-expand rather than this function, to see whether a widget, or any of its children, has the expand flag set. If any child of a widget wants to expand, the parent may ask to expand also.

This function only looks at the widget's own hexpand flag, rather than computing whether the entire widget tree rooted at this widget wants to expand.

The generic function (setf gtk-widget-hexpand) sets whether the widget would like any available extra horizontal space. Call this function to set the expand flag if you would like your widget to become larger horizontally when the window has extra room.

By default, widgets automatically expand if any of their children want to expand. To see if a widget will automatically expand given its current children and state, call the function gtk-widget-compute-expand. A container can decide how the expandability of children affects the expansion of the container by overriding the compute_expand virtual method on gtk-widget.

Setting hexpand explicitly with this function will override the automatic expand behavior.

This function forces the widget to expand or not to expand, regardless of children. The override occurs because the function gtk-widget-hexpand sets the hexpand-set property, see the function gtk-widget-hexpand-set, which causes the widget's hexpand value to be used, rather than looking at children and widget state.

See also