CanvasTextModel


Description:

[ CCode ( has_construct_function = false , type = "GooCanvasItemModel*" ) ]
public CanvasTextModel (CanvasItemModel? parent, string string, double x, double y, double width, CanvasAnchorType 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):

<informalexample><programlisting> GooCanvasItemModel *text = goo_canvas_text_model_new (mygroup, "Hello World", 500.0, 500.0, 200.0, GOO_CANVAS_ANCHOR_SE, "fill-color", "blue", NULL); </programlisting></informalexample>

Parameters:

parent

the parent model, 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 unref to free it.

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 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 model.