Skip to content
  • Havoc Pennington's avatar
    Add horizontal and vertical expand flags, compute_expand() to GtkWidget · 031856eb
    Havoc Pennington authored and Matthias Clasen's avatar Matthias Clasen committed
    GtkWidget now has flags for horizontal and vertical expand, and
    a compute_expand() method. compute_expand() is used by containers
    to set a default expand flag. (If a widget has expand set explicitly,
    it always overrides the results of compute_expand.)
    
    GtkContainer has a default implementation of compute_expand which
    simply walks over all child widgets and sets expand=TRUE
    if any child is expanding.
    
    The overall effect is that you only have to set expand on
    leaf nodes in the widget tree, while previously you had to
    set expand all the way up the tree as you packed every
    container. Also, now containers need not have their own child
    properties for expand.
    
    For old containers which do have "expand" child properties,
    they should override compute_expand and include the child
    properties in whether the container is expand=TRUE.
    Also, the old container should use
    "child_prop_expand || gtk_widget_compute_expand()" everywhere
    it previously used simply "child_prop_expand"
    
    https://bugzilla.gnome.org/show_bug.cgi?id=628902
    031856eb