Stk.CanvasSourceCanvas.
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.
class virtual item : ?group:group option -> ?x:int option -> ?y:int option -> unit -> object ... endThis 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.
class virtual full_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 ... endA full_item is a Widget.widget with item interface.
class virtual +'b container_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 ... enda container_item is a Container.container with item interface.
class group : ?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 ... endA group is a [full_item] container_item. Its kind is "canvas_group".
class rect : ?classes:string list option -> ?name:string option -> ?props:Props.t option -> ?wdata:
Widget.wdata
option -> ?group:group option -> ?x:int option -> ?y:int option -> w:
int -> h:int -> unit -> object ... endAn item to draw a rectangle. Its kind is "rect". Width and height of the rectangle can be specified with optional arguments w and h.
class bezier_curve : ?classes:string list option -> ?name:string option -> ?props:Props.t option -> ?wdata:
Widget.wdata
option -> ?group:group option -> ?x:int option -> ?y:int option -> ?points:
(int * int) list
option -> unit -> object ... endWidgets inheriting a widget and an item keeps the original widget kind but can be identified specifically in theming for example by using "canvas > <kind>".
class bin : ?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 ... endA Bin.bin as item.
class label : ?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 ... endA Text.label as item.
class glyph : ?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 ... endA Text.glyph as item.
class 'a box : ?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 ... endA Pack.box as item.
class paned : ?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 ... endA Pack.paned as item.
class fixed_size : ?classes:string list option -> ?name:string option -> ?props:Props.t option -> ?wdata:
Widget.wdata
option -> ?group:group option -> ?x:int option -> ?y:int option -> ?w:
int
option -> ?h:int option -> unit -> object ... endA Bin.fixed_size as item.
class 'a flex : ?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 ... endA Flex.flex as item.
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 :
?classes:string list ->
?name:string ->
?props:Props.t ->
?wdata:Widget.wdata ->
?group:group ->
?x:int ->
?y:int ->
unit ->
groupCreates a group.
val rect :
?classes:string list ->
?name:string ->
?props:Props.t ->
?wdata:Widget.wdata ->
?group:group ->
?x:int ->
?y:int ->
w:int ->
h:int ->
unit ->
rectCreates a rect.
val bezier_curve :
?classes:string list ->
?name:string ->
?props:Props.t ->
?wdata:Widget.wdata ->
?group:group ->
?x:int ->
?y:int ->
?points:(int * int) list ->
unit ->
bezier_curveCreates a bezier_curve.
val bin :
?classes:string list ->
?name:string ->
?props:Props.t ->
?wdata:Widget.wdata ->
?group:group ->
?x:int ->
?y:int ->
unit ->
binCreates a bin.
val label :
?classes:string list ->
?name:string ->
?props:Props.t ->
?wdata:Widget.wdata ->
?group:group ->
?x:int ->
?y:int ->
string ->
labelCreates a label.
val glyph :
?classes:string list ->
?name:string ->
?props:Props.t ->
?wdata:Widget.wdata ->
?group:group ->
?x:int ->
?y:int ->
int ->
glyphCreates a glyph.
val vbox :
?classes:string list ->
?name:string ->
?props:Props.t ->
?wdata:Widget.wdata ->
?group:group ->
?x:int ->
?y:int ->
unit ->
'a boxCreates a box with vertical orientation.
val hbox :
?classes:string list ->
?name:string ->
?props:Props.t ->
?wdata:Widget.wdata ->
?group:group ->
?x:int ->
?y:int ->
unit ->
'a boxCreates a box with horizontal orientation.
val vpaned :
?classes:string list ->
?name:string ->
?props:Props.t ->
?wdata:Widget.wdata ->
?group:group ->
?x:int ->
?y:int ->
unit ->
panedCreates a paned with vertical orientation.
val hpaned :
?classes:string list ->
?name:string ->
?props:Props.t ->
?wdata:Widget.wdata ->
?group:group ->
?x:int ->
?y:int ->
unit ->
panedCreates a paned with horizontal orientation.
val fixed_size :
?classes:string list ->
?name:string ->
?props:Props.t ->
?wdata:Widget.wdata ->
?group:group ->
?x:int ->
?y:int ->
?w:int ->
?h:int ->
unit ->
fixed_sizeCreates a fixed_size.
val flex :
?classes:string list ->
?name:string ->
?props:Props.t ->
?wdata:Widget.wdata ->
?group:group ->
?x:int ->
?y:int ->
?orientation:Props.orientation ->
?justification:Flex.justification ->
?items_alignment:Flex.items_alignment ->
?content_alignment:Flex.content_alignment ->
?inter_space:int ->
?wrap:bool ->
?wrap_on_break:bool ->
?collapse_spaces:bool ->
unit ->
'a flexCreates a flex.
class canvas : ?classes:string list option -> ?name:string option -> ?props:Props.t option -> ?wdata:
Widget.wdata
option -> unit -> object ... endval canvas :
?classes:string list ->
?name:string ->
?props:Props.t ->
?wdata:Widget.wdata ->
?pack:(Widget.widget -> unit) ->
unit ->
canvasConvenient function to create a canvas. See Widget arguments for arguments.