Top |
PangoAlignment | alignment | Read / Write |
GooCanvasAnchorType | anchor | Read / Write |
PangoEllipsizeMode | ellipsize | Read / Write |
gdouble | height | Read / Write |
gchar * | text | Read / Write |
gboolean | use-markup | Read / Write |
gdouble | width | Read / Write |
PangoWrapMode | wrap | Read / Write |
gdouble | x | Read / Write |
gdouble | y | Read / Write |
GooCanvasTextModel represents a model for text items.
It is a subclass of GooCanvasItemModelSimple and so inherits all of the style properties such as "fill-color".
It also implements the GooCanvasItemModel interface, so you can use the
GooCanvasItemModel functions such as goo_canvas_item_model_raise()
and
goo_canvas_item_model_rotate()
.
To create a GooCanvasTextModel use goo_canvas_text_model_new()
.
To get or set the properties of an existing GooCanvasTextModel, use
g_object_get()
and g_object_set()
.
To respond to events such as mouse clicks on the text item you must connect
to the signal handlers of the corresponding GooCanvasText objects.
(See goo_canvas_get_item()
and “item-created”.)
GooCanvasItemModel * goo_canvas_text_model_new (GooCanvasItemModel *parent
,const char *string
,gdouble x
,gdouble y
,gdouble width
,GooCanvasAnchorType anchor
,...
);
Creates a new text model.
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 |
GooCanvasItemModel *text = goo_canvas_text_model_new (mygroup, "Hello World", 500.0, 500.0, 200.0, GOO_CANVAS_ANCHOR_SE, "fill-color", "blue", NULL); |
parent |
the parent model, or |
[skip] |
string |
the text to display. |
|
x |
the x coordinate of the text. |
|
y |
the y coordinate of the text. |
|
width |
the width of the text item, or -1 for unlimited width. |
|
anchor |
the position of the text relative to the given |
|
... |
optional pairs of property names and values, and a terminating |
struct GooCanvasTextModel;
The GooCanvasTextModel struct contains private data only.
“alignment”
property “alignment” PangoAlignment
How to align the text.
Flags: Read / Write
Default value: PANGO_ALIGN_LEFT
“anchor”
property“anchor” GooCanvasAnchorType
How to position the text relative to the given x and y coordinates.
Flags: Read / Write
Default value: GOO_CANVAS_ANCHOR_NORTH_WEST
“ellipsize”
property “ellipsize” PangoEllipsizeMode
The preferred place to ellipsize the string, if the label does not have enough room to display the entire string.
Flags: Read / Write
Default value: PANGO_ELLIPSIZE_NONE
“height”
property “height” gdouble
The height to use to layout the text, or -1 to let the text use as much vertical space as needed.
Flags: Read / Write
Default value: -1
“use-markup”
property “use-markup” gboolean
Whether to parse PangoMarkup in the text, to support different styles.
Flags: Read / Write
Default value: FALSE
“width”
property “width” gdouble
The width to use to layout the text, or -1 to let the text use as much horizontal space as needed.
Flags: Read / Write
Default value: -1
“wrap”
property “wrap” PangoWrapMode
The preferred method of wrapping the string if a width has been set.
Flags: Read / Write
Default value: PANGO_WRAP_WORD