|GooCanvas Reference Manual|
|Top | Description | Object Hierarchy | Implemented Interfaces | Properties|
GooCanvasWidget; GooCanvasItem* goo_canvas_widget_new (
GObject +----GooCanvasItemSimple +----GooCanvasWidget
GooCanvasWidget implements GooCanvasItem.
GooCanvasWidget provides support for placing any GtkWidget in the canvas.
Note that there are a number of limitations in the use of GooCanvasWidget:
It doesn't support any transformation besides simple translation. This means you can't scale a canvas with a GooCanvasWidget in it.
It doesn't support layering, so you can't place other items beneath or above the GooCanvasWidget.
It doesn't support rendering of widgets to a given cairo_t, which means you can't output the widget to a pdf or postscript file.
It doesn't have a model/view variant like the other standard items, so it can only be used in a simple canvas without a model.
It can't be made a static item.
typedef struct _GooCanvasWidget GooCanvasWidget;
The GooCanvasWidget struct contains private data only.
GooCanvasItem* goo_canvas_widget_new (
Creates a new widget item.
||the parent item, or
||the x coordinate of the item.|
||the y coordinate of the item.|
||the width of the item, or -1 to use the widget's requested width.|
||the height of the item, or -1 to use the widget's requested height.|
||optional pairs of property names and values, and a terminating
|a new widget item.|
Here's an example showing how to create an entry widget centered at (100.0, 100.0):
1 2 3 4 5
GtkWidget *entry = gtk_entry_new (); GooCanvasItem *witem = goo_canvas_widget_new (mygroup, entry, 100, 100, -1, -1, "anchor", GTK_ANCHOR_CENTER, NULL);
"anchor" GtkAnchorType : Read / Write
How to position the widget relative to the item's x and y coordinate settings.
Default value: GTK_ANCHOR_NORTH_WEST
"height" gdouble : Read / Write
The height of the widget, or -1 to use its requested height.
Default value: -1
"width" gdouble : Read / Write
The width of the widget, or -1 to use its requested width.
Default value: -1