A canvas widget is composed of a root canvas group. A group can contain full_items (a groups is a fullitem too).
Coordinates of an item are relative to its parent group.
All item classes takes optional x and y arguments to define their coordinates relatively to their group, with default value 0. The group can be given with the optional group argument, or set with the set_group method. These three arguments are also handled by convenient functions to create items.
Items
Sourceclassvirtualitem : ?group:group option->?x:int option->?y:int option->unit ->object ... end
This virtual class defines the item interface. Most of the virtual methods correspond to methods of Widget.widget and are defined by inherting from Widget.widget or other widgets.
Sourceclassvirtualfull_item : ?classes:string list option->?name:string option->?props:Props.t option->?wdata:
Widget.wdata
option->?group:group option->?x:int option->?y:int option->
unit ->object ... end
Widgets inheriting a widget and an item keeps the original widget kind but can be identified specifically in theming for example by using "canvas > <kind>".
Sourceclassbin : ?classes:string list option->?name:string option->?props:Props.t option->?wdata:
Widget.wdata
option->?group:group option->?x:int option->?y:int option->
unit ->object ... end
These convenient functions are used to create items. They all take x and y optional arguments to specify the coordinates of the created item, and group to specify the group the item belongs to. Other arguments are generic widget arguments or arguments specific to the kind of item.