efl.evas.Grid Class

class efl.evas.Grid(Canvas canvas, **kwargs)

Bases: efl.evas.Object

TODO: doc this object

Parameters
  • canvas (Canvas) – The 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 grid that is child of a given element parent.

children

Get the list of children for the grid.

Type

list

children_get()
clear(clear)

Faster way to remove all child objects from a grid object.

Parameters

clear – if True, it will delete just removed children.

grid_size

The virtual resolution for the grid

Type

(int w, int h)

grid_size_get()
grid_size_set(w, h)
mirrored

The mirrored mode of the grid.

In mirrored mode the grid items go from right to left instead of left to right. That is, 0,0 is top right, not top left.

Type

bool

mirrored_get()
mirrored_set(mirrored)
pack(child, x, y, w, h)

Add a new child to a grid object.

Parameters
  • child – The child object to add.

  • x – The virtual x coordinate of the child

  • y – The virtual y coordinate of the child

  • w – The virtual width of the child

  • h – The virtual height of the child

Raises

RuntimeError – if the child could not be packed to the grid.

pack_get(child)

Get the pack options for a grid child

Get the pack x, y, width and height in virtual coordinates set by evas_object_grid_pack()

Parameters

child – The grid child to query for coordinates

Returns

(int x, int y, int w, int h)

Raises

RuntimeError – if packing information could not be fetched.

unpack(child)

Remove child from grid.

Parameters

child

Raises

RuntimeError – if removing the child fails.

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_grid_clear() instead.