efl.evas.Table
Class¶
- class efl.evas.Table(Canvas canvas, **kwargs)¶
Bases:
efl.evas.Object
TODO: doc this class
- Parameters
canvas (
Canvas
) – Evas canvas for this object**kwargs – All the remaining keyword arguments are interpreted as properties of the instance
- classmethod add_to(cls, parent)¶
Create a table that is child of a given parent.
- Parameters
parent (
Object
) –
- align¶
Set the alignment of the whole bounding box of contents.
- Type
(double horizontal, double vertical)
- align_get()¶
- align_set(horizontal, vertical)¶
- child_get(col, row)¶
Get the child of the table at the given coordinates
- Parameters
col (int) –
row (int) –
Note
This does not take into account col/row spanning
- children_get()¶
Get the list of children for the table.
- Type
list of Objects
- clear(clear)¶
Faster way to remove all child objects from a table object.
- Parameters
clear – if True, it will delete just removed children.
- col_row_size¶
Get the number of columns and rows this table takes.
Note
columns and rows are virtual entities, one can specify a table with a single object that takes 4 columns and 5 rows. The only difference for a single cell table is that padding will be accounted proportionally.
- col_row_size_get()¶
- homogeneous¶
Set how this table should layout children.
- Todo
consider aspect hint and respect it.
- EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE
If table does not use homogeneous mode then columns and rows will be calculated based on hints of individual cells. This operation mode is more flexible, but more complex and heavy to calculate as well. Weight properties are handled as a boolean expand. Negative alignment will be considered as 0.5. This is the default.
- Todo
EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE should balance weight.
- EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE
When homogeneous is relative to table the own table size is divided equally among children, filling the whole table area. That is, if table has
WIDTH
andCOLUMNS
, each cell will getWIDTH / COLUMNS
pixels. If children have minimum size that is larger than this amount (including padding), then it will overflow and be aligned respecting the alignment hint, possible overlapping sibling cells. Weight hint is used as a boolean, if greater than zero it will make the child expand in that axis, taking as much space as possible (bounded to maximum size hint). Negative alignment will be considered as 0.5.- EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM
When homogeneous is relative to item it means the greatest minimum cell size will be used. That is, if no element is set to expand, the table will have its contents to a minimum size, the bounding box of all these children will be aligned relatively to the table object using evas_object_table_align_get(). If the table area is too small to hold this minimum bounding box, then the objects will keep their size and the bounding box will overflow the box area, still respecting the alignment. Weight hint is used as a boolean, if greater than zero it will make that cell expand in that axis, toggling the expand mode, which makes the table behave much like EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE, except that the bounding box will overflow and items will not overlap siblings. If no minimum size is provided at all then the table will fallback to expand mode as well.
- Type
Evas_Object_Table_Homogeneous_Mode
- homogeneous_get()¶
- homogeneous_set(homogeneous)¶
- mirrored¶
Sets the mirrored mode of the table. In mirrored mode the table items go from right to left instead of left to right. That is, 1,1 is top right, not top left.
- Type
bool
- mirrored_get()¶
- mirrored_set(mirrored)¶
- pack(child, col, row, colspan, rowspan)¶
Add a new child to a table object or set its current packing.
- Parameters
child – The child object to add.
col – relative-horizontal position to place child.
row – relative-vertical position to place child.
colspan – how many relative-horizontal position to use for this child.
rowspan – how many relative-vertical position to use for this child.
- Raises
RuntimeError – when the child cannot be packed to the table.
- pack_get(child)¶
Get packing location of a child of table
- Parameters
child – The child object to add.
col – pointer to store relative-horizontal position to place child.
row – pointer to store relative-vertical position to place child.
colspan – pointer to store how many relative-horizontal position to use for this child.
rowspan – pointer to store how many relative-vertical position to use for this child.
- Raises
RuntimeError – when the packing location cannot be fetched.
- padding¶
Padding between cells.
- Type
(int horizontal, int vertical)
- padding_get()¶
- padding_set(horizontal, vertical)¶
- unpack(child)¶
Remove child from table.
Note
Removing a child will immediately call a walk over children in order to recalculate numbers of columns and rows. If you plan to remove all children, use evas_object_table_clear() instead.
- Raises
RuntimeError – when the child cannot be removed from the table.