Legend:
Library
Module
Module type
Parameter
Class
Class type
Canvas.
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
classvirtualitem : ?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.
classfull_item : ?class_:string option->?name:string option->?props:Props.t option->?group:
group
option->?x:int option->?y:int option->unit ->object ... end
class +'b container_item : ?class_:string option->?name:string option->?props:Props.t option->?group:
group
option->?x:int option->?y:int option->unit ->object ... end
classgroup : ?class_:string option->?name:string option->?props:Props.t option->?group:
group
option->?x:int option->?y:int option->unit ->object ... end
A group is a [full_item] container_item. Its default class_ is "canvas_group".
classrect : ?class_:string option->?name:string option->?props:Props.t option->?group:
group
option->?x:int option->?y:int option->w:int ->h:int ->unit ->object ... end
An item to draw a rectangle. Default class_ is "canvas_rect". Width and height of the rectangle can be specified with optional arguments w and h.
classlabel : ?class_:string option->?name:string option->?props:Props.t option->?group:
group
option->?x:int option->?y:int option->unit ->object ... end
A Text.label as item. Default class_ is "canvas_label".
classglyph : ?class_:string option->?name:string option->?props:Props.t option->?group:
group
option->?x:int option->?y:int option->unit ->object ... end
A Text.glyph as item. Default class_ is "canvas_glyph".
class 'a box : ?class_:string option->?name:string option->?props:Props.t option->?group:
group
option->?x:int option->?y:int option->unit ->object ... end
class 'a flex : ?class_:string option->?name:string option->?props:Props.t option->?group:
group
option->?x:int option->?y:int option->unit ->object ... end
A Flex.flex as item. Default class_ is "canvas_flex".
Convenient functions to create items
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.
val group :
?class_:string ->?name:string ->?props:Props.t->?group:group->?x:int ->?y:int ->unit ->group