![]() |
![]() |
![]() |
GooCanvas Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties |
struct GooCanvasText; GooCanvasItem * goo_canvas_text_new (GooCanvasItem *parent
,const char *string
,gdouble x
,gdouble y
,gdouble width
,GooCanvasAnchorType anchor
,...
); void goo_canvas_text_get_natural_extents (GooCanvasText *text
,PangoRectangle *ink_rect
,PangoRectangle *logical_rect
);
"alignment" PangoAlignment : Read / Write "anchor" GooCanvasAnchorType : Read / Write "ellipsize" PangoEllipsizeMode : Read / Write "height" gdouble : Read / Write "text" gchar* : Read / Write "use-markup" gboolean : Read / Write "width" gdouble : Read / Write "wrap" PangoWrapMode : Read / Write "x" gdouble : Read / Write "y" gdouble : Read / Write
GooCanvasText represents a text item.
It is a subclass of GooCanvasItemSimple and so inherits all of the style properties such as "fill-color".
It also implements the GooCanvasItem interface, so you can use the
GooCanvasItem functions such as goo_canvas_item_raise()
and
goo_canvas_item_rotate()
.
The "width" and "height" properties specify the area of the item. If it exceeds that area because there is too much text, it is clipped. The properties can be set to -1 to disable clipping.
To create a GooCanvasText use goo_canvas_text_new()
.
To get or set the properties of an existing GooCanvasText, use
g_object_get()
and g_object_set()
.
GooCanvasItem * goo_canvas_text_new (GooCanvasItem *parent
,const char *string
,gdouble x
,gdouble y
,gdouble width
,GooCanvasAnchorType anchor
,...
);
Creates a new text item.
|
the parent item, or NULL . If a parent is specified, it will assume
ownership of the item, and the item will automatically be freed when it is
removed from the parent. Otherwise call g_object_unref() to free it. [skip]
|
|
the text to display. |
|
the x coordinate of the text. |
|
the y coordinate of the text. |
|
the width of the text item, or -1 for unlimited width. |
|
the position of the text relative to the given x and y
coordinates. For example an anchor of GDK_ANCHOR_NW will result in the
top-left of the text being placed at the given x and y coordinates.
An anchor of GDK_ANCHOR_CENTER will result in the center of the text being
placed at the x and y coordinates. |
|
optional pairs of property names and values, and a terminating NULL . |
Returns : |
a new text item. [transfer full] |
Here's an example showing how to create a text item with the bottom right of the text box placed at (500,500):
1 2 3 4 5 6 |