HippoCanvasContainer

HippoCanvasContainer

Functions

Types and Values

Object Hierarchy

    GInterface
    ╰── HippoCanvasContainer

Known Implementations

HippoCanvasContainer is implemented by HippoCanvasBox, HippoCanvasGradient, HippoCanvasImage, HippoCanvasImageButton, HippoCanvasLink and HippoCanvasText.

Includes

#include <hippo/hippo-canvas-container.h>

Description

Functions

hippo_canvas_container_get_child_visible ()

gboolean
hippo_canvas_container_get_child_visible
                               (HippoCanvasContainer *container,
                                HippoCanvasItem *child);


hippo_canvas_container_set_child_visible ()

void
hippo_canvas_container_set_child_visible
                               (HippoCanvasContainer *container,
                                HippoCanvasItem *child,
                                gboolean visible);

This is the equivalent of gtk_widget_show() and gtk_widget_hide() for GtkWidget. Unlike GtkWidget, in HippoCanvas visibility is a property of the container-child pair rather than a property of the child itself. Thus, if you remove a child from a container its visibility state is lost.

Internally, invisible children are just allocated a 0x0 size; they are not otherwise told they are invisible.

Making this a "child property" on the container instead of a flag on HippoCanvasItem is perhaps a little surprising, but is consistent with e.g. having the allocation origin in the container also. The general theme is that HippoCanvasItem has minimal knowledge of its context - doesn't know its origin coords, parent item, or whether it will be painted at all. Which makes it easier to implement canvas items and easier to use them in different/multiple contexts, but makes containers harder and more complex.

An implementation convenience of this approach is that the Windows and Linux canvas widgets need not handle the visibility of their root items.

Parameters

container

the container item

 

child

child that is inside the container

 

visible

FALSE if child should be given a 0x0 allocation and therefore be invisible

 

Types and Values

HippoCanvasContainer

typedef struct _HippoCanvasContainer HippoCanvasContainer;


HippoCanvasContainerIface

typedef struct {
    GTypeInterface base_iface;

    gboolean (* get_child_visible) (HippoCanvasContainer        *container,
                                    HippoCanvasItem             *child);
    void     (* set_child_visible) (HippoCanvasContainer        *container,
                                    HippoCanvasItem             *child,
                                    gboolean                     visible);
} HippoCanvasContainerIface;