|
Etk_Canvas
Detailed Description
The Etk_Canvas widget is a container which allows you to position widgets at canvas coordinates.
Etk_Canvas allows you to easily position widgets at canvas coordinates. The children will have the same size as their requested-size. So to force a child to have a canvas size, you can call etk_widget_size_request_set() on the child.
Fox example, to put a button at the position (20, 30), with the size 100x30:
Etk_Canvas may seem to make widget positioning simpler but you should actually avoid using it as much as possible. Indeed, using canvas positions may make widgets overlap and the result can look differently on different configurations (different themes, different fonts, different languages, ...). Also, if you'll ever want to remove a child from the canvas container, you will probably have to reposition all the other children of the canvas container. It's heavily advised to use Etk_Box, Etk_Table or any other kind of containers instead of a canvas container.
- Object Hierarchy:
-
|
Data Structures |
struct | Etk_Canvas |
| [Widget] A container which allows you to position widgets at canvas coordinates More...
|
Defines |
#define | ETK_CANVAS_TYPE (etk_canvas_type_get()) |
#define | ETK_CANVAS(obj) (ETK_OBJECT_CAST((obj), ETK_CANVAS_TYPE, Etk_Canvas)) |
#define | ETK_IS_CANVAS(obj) (ETK_OBJECT_CHECK_TYPE((obj), ETK_CANVAS_TYPE)) |
Functions |
Etk_Widget * | etk_canvas_new (void) |
| Creates a new canvas container.
|
void | etk_canvas_put (Etk_Canvas *canvas, Etk_Widget *widget, int x, int y) |
| Puts a new child into the canvas container, at the position (x, y).
|
void | etk_canvas_move (Etk_Canvas *canvas, Etk_Widget *widget, int x, int y) |
| Moves an existing child of the canvas container to the position (x, y).
|
void | etk_canvas_child_position_get (Etk_Canvas *canvas, Etk_Widget *widget, int *x, int *y) |
| Gets the position of a child of the canvas container.
|
Etk_Widget * | etk_canvas_object_add (Etk_Canvas *canvas, Evas_Object *evas_object) |
| Adds an Evas_Object to the canvas. This is a convenience function that uses Etk_Evas_Object.
|
void | etk_canvas_object_remove (Etk_Canvas *canvas, Evas_Object *evas_object) |
| Removed an Evas_Object from the canvas.
|
void | etk_canvas_object_move (Etk_Canvas *canvas, Evas_Object *evas_object, int x, int y) |
| Moves an Evas_Object around in the canvas.
|
Define Documentation
#define ETK_CANVAS_TYPE (etk_canvas_type_get()) |
Gets the type of a canvas
#define ETK_CANVAS |
( |
obj |
|
) |
(ETK_OBJECT_CAST((obj), ETK_CANVAS_TYPE, Etk_Canvas)) |
#define ETK_IS_CANVAS |
( |
obj |
|
) |
(ETK_OBJECT_CHECK_TYPE((obj), ETK_CANVAS_TYPE)) |
Function Documentation
Creates a new canvas container.
- Returns:
- Returns the new canvas container
Puts a new child into the canvas container, at the position (x, y).
- Parameters:
-
| canvas | a canvas container |
| child | the child to add |
| x | the x position where to put the child |
| y | the y position where to put the child |
Moves an existing child of the canvas container to the position (x, y).
- Parameters:
-
| canvas | a canvas container |
| widget | the child to move |
| x | the x position where to move the child |
| y | the y position where to move the child |
Gets the position of a child of the canvas container.
- Parameters:
-
| canvas | a canvas container |
| widget | the child you want the position of |
| x | the location where to store the x position of the child (it can be NULL) |
| y | the location where to store the y position of the child (it can be NULL) |
- Note:
- if the child is not contained by the canvas container, x and y will be set to (0, 0)
Adds an Evas_Object to the canvas. This is a convenience function that uses Etk_Evas_Object.
- Parameters:
-
| canvas | the canvas container evas_object the evas object to add |
- Returns:
- returns the Etk_Evas_Object holding the evas_object
- Note:
- You will need to show the widget after it has been added.
void etk_canvas_object_remove |
( |
Etk_Canvas * |
canvas, |
|
|
Evas_Object * |
evas_object | |
|
) |
| | |
Removed an Evas_Object from the canvas.
- Parameters:
-
| canvas | the canvas container |
| evas_object | the Evas_Object to remove |
void etk_canvas_object_move |
( |
Etk_Canvas * |
canvas, |
|
|
Evas_Object * |
evas_object, |
|
|
int |
x, |
|
|
int |
y | |
|
) |
| | |
Moves an Evas_Object around in the canvas.
- Parameters:
-
| canvas | the canvas container |
| evas_object | the Evas_Object to move |
| x | the x coordinate to move to inside the canvas |
| y | the y coordinate to move to inside the canvas |
|
|