GooCanvasRectModel: GooCanvas Reference Manual

## GooCanvasRectModel GooCanvasRectModel — a model for rectangle items. |

## Functions

GooCanvasItemModel * | goo_canvas_rect_model_new ()

## Properties

double | height | Read / Write
double | radius-bottom-left-x | Read / Write
double | radius-bottom-left-y | Read / Write
double | radius-bottom-right-x | Read / Write
double | radius-bottom-right-y | Read / Write
double | radius-top-left-x | Read / Write
double | radius-top-left-y | Read / Write
double | radius-top-right-x | Read / Write
double | radius-top-right-y | Read / Write
double | radius-x | Read / Write
double | radius-y | Read / Write
double | width | Read / Write
double | x | Read / Write
double | y | Read / Write

## Types and Values

struct | GooCanvasRectModel

## Object Hierarchy

        GObject
        ╰── GooCanvasItemModelSimple
            ╰── GooCanvasRectModel

## Implemented Interfaces

GooCanvasRectModel implements GooCanvasItemModel.

## Description

GooCanvasRectModel represents a model for rectangle items.

It is a subclass of GooCanvasItemModelSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width".

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 GooCanvasRectModel use `goo_canvas_rect_model_new()`.

To get or set the properties of an existing GooCanvasRectModel, use `g_object_get()` and `g_object_set()`.

To respond to events such as mouse clicks on the rectangle you must connect to the signal handlers of the corresponding GooCanvasRect objects. (See `goo_canvas_get_item()` and “item-created”.)

## Functions

### goo_canvas_rect_model_new ()

    GooCanvasItemModel *
    goo_canvas_rect_model_new (GooCanvasItemModel *parent,
                               gdouble x,
                               gdouble y,
                               gdouble width,
                               gdouble height,
                               ...);

Creates a new rectangle item.

Here's an example showing how to create a rectangle at (100,100) with a width of 200 and a height of 100.

    1
    2
    3
    4
    5
    GooCanvasItemModel *rect = goo_canvas_rect_model_new (mygroup, 100.0, 100.0, 200.0, 100.0,
                                                          "stroke-color", "red",
                                                          "line-width", 5.0,
                                                          "fill-color", "blue",
                                                          NULL);

#### 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 `g_object_unref()` to free it. | [skip]
x | the x coordinate of the left of the rectangle. |
y | the y coordinate of the top of the rectangle. |
width | the width of the rectangle. |
height | the height of the rectangle. |
... | optional pairs of property names and values, and a terminating `NULL`. |

#### Returns

a new rectangle model.

[transfer full]

## Types and Values

### struct GooCanvasRectModel

    struct GooCanvasRectModel;

The GooCanvasRectModel struct contains private data only.

## Property Details

### The `“height”` property

      “height”                   double

The height of the rectangle.

Owner: GooCanvasRectModel

Flags: Read / Write

Allowed values: >= 0

Default value: 0

### The `“radius-bottom-left-x”` property

      “radius-bottom-left-x”     double

The horizontal bottom left radius to use for rounded corners.

Owner: GooCanvasRectModel

Flags: Read / Write

Allowed values: >= 0

Default value: 0

### The `“radius-bottom-left-y”` property

      “radius-bottom-left-y”     double

The vertical bottom left radius to use for rounded corners.

Owner: GooCanvasRectModel

Flags: Read / Write

Allowed values: >= 0

Default value: 0

### The `“radius-bottom-right-x”` property

      “radius-bottom-right-x”    double

The horizontal bottom right radius to use for rounded corners.

Owner: GooCanvasRectModel

Flags: Read / Write

Allowed values: >= 0

Default value: 0

### The `“radius-bottom-right-y”` property

      “radius-bottom-right-y”    double

The vertical bottom right radius to use for rounded corners.

Owner: GooCanvasRectModel

Flags: Read / Write

Allowed values: >= 0

Default value: 0

### The `“radius-top-left-x”` property

      “radius-top-left-x”        double

The horizontal top left radius to use for rounded corners.

Owner: GooCanvasRectModel

Flags: Read / Write

Allowed values: >= 0

Default value: 0

### The `“radius-top-left-y”` property

      “radius-top-left-y”        double

The vertical top left radius to use for rounded corners.

Owner: GooCanvasRectModel

Flags: Read / Write

Allowed values: >= 0

Default value: 0

### The `“radius-top-right-x”` property

      “radius-top-right-x”       double

The horizontal top right radius to use for rounded corners.

Owner: GooCanvasRectModel

Flags: Read / Write

Allowed values: >= 0

Default value: 0

### The `“radius-top-right-y”` property

      “radius-top-right-y”       double

The vertical top right radius to use for rounded corners.

Owner: GooCanvasRectModel

Flags: Read / Write

Allowed values: >= 0

Default value: 0

### The `“radius-x”` property

      “radius-x”                 double

The horizontal radius to use for rounded corners.

Owner: GooCanvasRectModel

Flags: Read / Write

Allowed values: >= 0

Default value: 0

### The `“radius-y”` property

      “radius-y”                 double

The vertical radius to use for rounded corners.

Owner: GooCanvasRectModel

Flags: Read / Write

Allowed values: >= 0

Default value: 0

### The `“width”` property

      “width”                    double

The width of the rectangle.

Owner: GooCanvasRectModel

Flags: Read / Write

Allowed values: >= 0

Default value: 0

### The `“x”` property

      “x”                        double

The x coordinate of the rectangle.

Owner: GooCanvasRectModel

Flags: Read / Write

Default value: 0

### The `“y”` property

      “y”                        double

The y coordinate of the rectangle.

Owner: GooCanvasRectModel

Flags: Read / Write

Default value: 0