Top | ![]() |
![]() |
![]() |
![]() |
gboolean | hippo_canvas_container_get_child_visible () |
void | hippo_canvas_container_set_child_visible () |
HippoCanvasContainer is implemented by HippoCanvasBox, HippoCanvasGradient, HippoCanvasImage, HippoCanvasImageButton, HippoCanvasLink and HippoCanvasText.
gboolean hippo_canvas_container_get_child_visible (HippoCanvasContainer *container
,HippoCanvasItem *child
);
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.