Top |
gdouble | column-spacing | Read / Write |
gboolean | homogeneous-columns | Read / Write |
gboolean | homogeneous-rows | Read / Write |
gdouble | horz-grid-line-width | Read / Write |
gdouble | row-spacing | Read / Write |
gdouble | vert-grid-line-width | Read / Write |
gdouble | x-border-spacing | Read / Write |
gdouble | y-border-spacing | Read / Write |
gdouble | bottom-padding | Read / Write |
guint | column | Read / Write |
guint | columns | Read / Write |
gdouble | left-padding | Read / Write |
gdouble | right-padding | Read / Write |
guint | row | Read / Write |
guint | rows | Read / Write |
gdouble | top-padding | Read / Write |
gdouble | x-align | Read / Write |
gboolean | x-expand | Read / Write |
gboolean | x-fill | Read / Write |
gboolean | x-shrink | Read / Write |
gdouble | y-align | Read / Write |
gboolean | y-expand | Read / Write |
gboolean | y-fill | Read / Write |
gboolean | y-shrink | Read / Write |
GooCanvasTable is a table container used to lay out other canvas items. It is used in a similar way to how the GtkTable widget is used to lay out GTK+ widgets.
Items are added to the table using the normal methods, then
goo_canvas_item_set_child_properties()
is used to specify how each child
item is to be positioned within the table (i.e. which row and column it is
in, how much padding it should have and whether it should expand or
shrink).
GooCanvasTable is a subclass of GooCanvasItemSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width". Setting a style property on a GooCanvasTable will affect all children of the GooCanvasTable (unless the children override the property setting).
GooCanvasTable implements the GooCanvasItem interface, so you can use
the GooCanvasItem functions such as goo_canvas_item_raise()
and
goo_canvas_item_rotate()
, and the properties such as "visibility" and
"pointer-events".
To create a GooCanvasTable use goo_canvas_table_new()
.
To get or set the properties of an existing GooCanvasTable, use
g_object_get()
and g_object_set()
.
GooCanvasItem * goo_canvas_table_new (GooCanvasItem *parent
,...
);
Creates a new table item.
Here's an example showing how to create a table with a square, a circle and a triangle in it:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
GooCanvasItem *table, *square, *circle, *triangle; table = goo_canvas_table_new (root, "row-spacing", 4.0, "column-spacing", 4.0, NULL); goo_canvas_item_translate (table, 400, 200); square = goo_canvas_rect_new (table, 0.0, 0.0, 50.0, 50.0, "fill-color", "red", NULL); goo_canvas_item_set_child_properties (table, square, "row", 0, "column", 0, NULL); circle = goo_canvas_ellipse_new (table, 0.0, 0.0, 25.0, 25.0, "fill-color", "blue", NULL); goo_canvas_item_set_child_properties (table, circle, "row", 0, "column", 1, NULL); triangle = goo_canvas_polyline_new (table, TRUE, 3, 25.0, 0.0, 0.0, 50.0, 50.0, 50.0, "fill-color", "yellow", NULL); goo_canvas_item_set_child_properties (table, triangle, "row", 0, "column", 2, NULL); |
parent |
the parent item, or |
[skip] |
... |
optional pairs of property names and values, and a terminating |
“column-spacing”
property “column-spacing” gdouble
The default space between columns.
Flags: Read / Write
Allowed values: >= 0
Default value: 0
“homogeneous-columns”
property “homogeneous-columns” gboolean
If all columns are the same width.
Flags: Read / Write
Default value: FALSE
“homogeneous-rows”
property “homogeneous-rows” gboolean
If all rows are the same height.
Flags: Read / Write
Default value: FALSE
“horz-grid-line-width”
property “horz-grid-line-width” gdouble
The width of the grid line to draw between rows.
Flags: Read / Write
Allowed values: >= 0
Default value: 0
“row-spacing”
property “row-spacing” gdouble
The default space between rows.
Flags: Read / Write
Allowed values: >= 0
Default value: 0
“vert-grid-line-width”
property “vert-grid-line-width” gdouble
The width of the grid line to draw between columns.
Flags: Read / Write
Allowed values: >= 0
Default value: 0
“x-border-spacing”
property “x-border-spacing” gdouble
The amount of spacing between the lefmost and rightmost cells and the border grid line.
Flags: Read / Write
Allowed values: >= 0
Default value: 0
“bottom-padding”
child property “bottom-padding” gdouble
Extra space to add below the item.
Flags: Read / Write
Allowed values: >= 0
Default value: 0
“column”
child property “column” guint
The column to place the item in.
Flags: Read / Write
Allowed values: <= 65535
Default value: 0
“columns”
child property “columns” guint
The number of columns that the item spans.
Flags: Read / Write
Allowed values: <= 65535
Default value: 1
“left-padding”
child property “left-padding” gdouble
Extra space to add to the left of the item.
Flags: Read / Write
Allowed values: >= 0
Default value: 0
“right-padding”
child property “right-padding” gdouble
Extra space to add to the right of the item.
Flags: Read / Write
Allowed values: >= 0
Default value: 0
“row”
child property “row” guint
The row to place the item in.
Flags: Read / Write
Allowed values: <= 65535
Default value: 0
“rows”
child property “rows” guint
The number of rows that the item spans.
Flags: Read / Write
Allowed values: <= 65535
Default value: 1
“top-padding”
child property “top-padding” gdouble
Extra space to add above the item.
Flags: Read / Write
Allowed values: >= 0
Default value: 0
“x-align”
child property “x-align” gdouble
The horizontal position of the item within its allocated space. 0.0 is left-aligned, 1.0 is right-aligned.
Flags: Read / Write
Allowed values: [0,1]
Default value: 0.5
“x-expand”
child property “x-expand” gboolean
If the item expands horizontally as the table expands.
Flags: Read / Write
Default value: FALSE
“x-fill”
child property “x-fill” gboolean
If the item fills all horizontal allocated space.
Flags: Read / Write
Default value: FALSE
“x-shrink”
child property “x-shrink” gboolean
If the item can shrink smaller than its requested size horizontally.
Flags: Read / Write
Default value: FALSE
“y-align”
child property “y-align” gdouble
The vertical position of the item within its allocated space. 0.0 is top-aligned, 1.0 is bottom-aligned.
Flags: Read / Write
Allowed values: [0,1]
Default value: 0.5
“y-expand”
child property “y-expand” gboolean
If the item expands vertically as the table expands.
Flags: Read / Write
Default value: FALSE
“y-fill”
child property “y-fill” gboolean
If the item fills all vertical allocated space.
Flags: Read / Write
Default value: FALSE