signature CANVAS structure Canvas : CANVAS
The Canvas structure provides access to a canvas implementation based on the Tcl/Tk canvas widget.
See the overview page for a general introduction to the GTK library binding.
import signature CANVAS from "x-alice:/lib/gtk/CANVAS-sig" import structure Canvas from "x-alice:/lib/gtk/Canvas"
signature CANVAS = sig type object = Gtk.object datatype event = EVENT_2BUTTON_PRESS of {button : int, device : object, send : bool, state : int, time : int, window : object, x : real, x_root : real, y : real, y_root : real} | EVENT_3BUTTON_PRESS of {button : int, device : object, send : bool, state : int, time : int, window : object, x : real, x_root : real, y : real, y_root : real} | EVENT_BUTTON_PRESS of {button : int, device : object, send : bool, state : int, time : int, window : object, x : real, x_root : real, y : real, y_root : real} | EVENT_BUTTON_RELEASE of {button : int, device : object, send : bool, state : int, time : int, window : object, x : real, x_root : real, y : real, y_root : real} | EVENT_CLIENT_EVENT | EVENT_CONFIGURE of {height : int, send : bool, width : int, window : object, x : int, y : int} | EVENT_DELETE | EVENT_DESTROY | EVENT_DRAG_ENTER | EVENT_DRAG_LEAVE | EVENT_DRAG_MOTION | EVENT_DRAG_STATUS | EVENT_DROP_FINISHED | EVENT_DROP_START | EVENT_ENTER_NOTIFY of {detail : int, focus : bool, mode : int, send : bool, state : int, subwindow : object, time : int, window : object, x : real, x_root : real, y : real, y_root : real} | EVENT_EXPOSE of {area_height : int, area_width : int, area_x : int, area_y : int, count : int, region : object, send : bool, window : object} | EVENT_FOCUS_CHANGE of {hasFocus : bool, send : bool, window : object} | EVENT_KEY_PRESS of {group : int, hardware_keycode : int, keyval : int, length : int, send : bool, state : int, string : string, time : int, window : object} | EVENT_KEY_RELEASE of {group : int, hardware_keycode : int, keyval : int, length : int, send : bool, state : int, string : string, time : int, window : object} | EVENT_LEAVE_NOTIFY of {detail : int, focus : bool, mode : int, send : bool, state : int, subwindow : object, time : int, window : object, x : real, x_root : real, y : real, y_root : real} | EVENT_MAP | EVENT_MOTION_NOTIFY of {device : object, is_hint : int, send : bool, state : int, time : int, window : object, x : real, x_root : real, y : real, y_root : real} | EVENT_NOTHING | EVENT_NO_EXPOSE of {send : bool, window : object} | EVENT_PROPERTY_NOTIFY | EVENT_PROXIMITY_IN | EVENT_PROXIMITY_OUT | EVENT_SCROLL of {device : object, direction : int, send : bool, state : int, time : int, window : object, x : real, x_root : real, y : real, y_root : real} | EVENT_SELECTION_CLEAR | EVENT_SELECTION_NOTIFY | EVENT_SELECTION_REQUEST | EVENT_SETTING | EVENT_UNMAP | EVENT_UNSUPPORTED of object | EVENT_VISIBILITY_NOTIFY of {send : bool, state : int, window : object} | EVENT_WINDOW_STATE datatype arg = BOOL of bool | EVENT of event | INT of int | LIST of object list | OBJECT of object | REAL of real | STRING of string val NULL : object val TRUE : int val FALSE : int type callback_function = object * arg list -> unit val signalConnect : object * string * callback_function -> int val signalConnectAfter : object * string * callback_function -> int val signalDisconnect : object * int -> unit val signalHandlerBlock : object * int -> unit val signalHandlerUnblock : object * int -> unit val latin1ToUtf8 : string -> string val utf8ToLatin1 : string -> string val lock : Lock.lock val itemGetType : unit -> int val itemConstruct : Gtk.object * Gtk.object * string * Core.arg list -> unit val itemSet : Gtk.object * string * Core.arg -> unit val itemSetValist : Gtk.object * string * Core.arg list -> unit val itemMove : Gtk.object * real * real -> unit val itemAffineRelative : Gtk.object * real vector -> unit val itemAffineAbsolute : Gtk.object * real vector -> unit val itemRaise : Gtk.object * int -> unit val itemLower : Gtk.object * int -> unit val itemRaiseToTop : Gtk.object -> unit val itemLowerToBottom : Gtk.object -> unit val itemShow : Gtk.object -> unit val itemHide : Gtk.object -> unit val itemGrab : Gtk.object * int * Gtk.object * int -> int val itemUngrab : Gtk.object * int -> unit val itemW2i : Gtk.object -> real * real val itemW2i' : Gtk.object * real * real -> real * real val itemI2w : Gtk.object -> real * real val itemI2w' : Gtk.object * real * real -> real * real val itemI2wAffine : Gtk.object * real vector -> unit val itemI2cAffine : Gtk.object * real vector -> unit val itemReparent : Gtk.object * Gtk.object -> unit val itemGrabFocus : Gtk.object -> unit val itemGetBounds : Gtk.object -> real * real * real * real val itemGetBounds' : Gtk.object * real * real * real * real -> real * real * real * real val itemRequestUpdate : Gtk.object -> unit val canvasGroupGetFieldItemList : Gtk.object -> Gtk.object list val canvasGroupSetFieldItemList : Gtk.object * Gtk.object list -> unit val groupGetType : unit -> int val getType : unit -> int val new : unit -> Gtk.object val newAa : unit -> Gtk.object val root : Gtk.object -> Gtk.object val setScrollRegion : Gtk.object * real * real * real * real -> unit val getScrollRegion : Gtk.object -> real * real * real * real val getScrollRegion' : Gtk.object * real * real * real * real -> real * real * real * real val setCenterScrollRegion : Gtk.object * bool -> unit val getCenterScrollRegion : Gtk.object -> bool val setPixelsPerUnit : Gtk.object * real -> unit val scrollTo : Gtk.object * int * int -> unit val getScrollOffsets : Gtk.object -> int * int val getScrollOffsets' : Gtk.object * int * int -> int * int val updateNow : Gtk.object -> unit val getItemAt : Gtk.object * real * real -> Gtk.object val requestRedrawUta : Gtk.object * Gtk.object -> unit val requestRedraw : Gtk.object * int * int * int * int -> unit val w2cAffine : Gtk.object * real vector -> unit val w2c : Gtk.object * real * real -> int * int val w2c' : Gtk.object * real * real * int * int -> int * int val w2cD : Gtk.object * real * real -> real * real val w2cD' : Gtk.object * real * real * real * real -> real * real val c2w : Gtk.object * int * int -> real * real val c2w' : Gtk.object * int * int * real * real -> real * real val windowToWorld : Gtk.object * real * real -> real * real val windowToWorld' : Gtk.object * real * real * real * real -> real * real val worldToWindow : Gtk.object * real * real -> real * real val worldToWindow' : Gtk.object * real * real * real * real -> real * real val getColor : Gtk.object * string * Gtk.object -> int val getColorPixel : Gtk.object * int -> int val setStippleOrigin : Gtk.object * Gtk.object -> unit val setDither : Gtk.object * GdkRgbDither -> unit val getDither : Gtk.object -> GdkRgbDither val lineGetType : unit -> int val textGetType : unit -> int val richTextGetType : unit -> int val richTextCutClipboard : Gtk.object -> unit val richTextCopyClipboard : Gtk.object -> unit val richTextPasteClipboard : Gtk.object -> unit val richTextSetBuffer : Gtk.object * Gtk.object -> unit val richTextGetBuffer : Gtk.object -> Gtk.object val richTextGetIterLocation : Gtk.object * Gtk.object * Gtk.object -> unit val richTextGetIterAtLocation : Gtk.object * Gtk.object * int * int -> unit val pathDefNew : unit -> Gtk.object val pathDefNewSized : int -> Gtk.object val pathDefNewFromBpath : Gtk.object -> Gtk.object val pathDefNewFromStaticBpath : Gtk.object -> Gtk.object val pathDefNewFromForeignBpath : Gtk.object -> Gtk.object val pathDefRef : Gtk.object -> unit val pathDefFinish : Gtk.object -> unit val pathDefEnsureSpace : Gtk.object * int -> unit val pathDefCopy : Gtk.object * Gtk.object -> unit val pathDefDuplicate : Gtk.object -> Gtk.object val pathDefConcat : Gtk.object list -> Gtk.object val pathDefSplit : Gtk.object -> Gtk.object list val pathDefOpenParts : Gtk.object -> Gtk.object val pathDefClosedParts : Gtk.object -> Gtk.object val pathDefCloseAll : Gtk.object -> Gtk.object val pathDefUnref : Gtk.object -> unit val pathDefReset : Gtk.object -> unit val pathDefMoveto : Gtk.object * real * real -> unit val pathDefLineto : Gtk.object * real * real -> unit val pathDefLinetoMoving : Gtk.object * real * real -> unit val pathDefCurveto : Gtk.object * real * real * real * real * real * real -> unit val pathDefClosepath : Gtk.object -> unit val pathDefClosepathCurrent : Gtk.object -> unit val pathDefBpath : Gtk.object -> Gtk.object val pathDefLength : Gtk.object -> int val pathDefIsEmpty : Gtk.object -> bool val pathDefHasCurrentpoint : Gtk.object -> bool val pathDefCurrentpoint : Gtk.object * Gtk.object -> unit val pathDefLastBpath : Gtk.object -> Gtk.object val pathDefFirstBpath : Gtk.object -> Gtk.object val pathDefAnyOpen : Gtk.object -> bool val pathDefAllOpen : Gtk.object -> bool val pathDefAnyClosed : Gtk.object -> bool val pathDefAllClosed : Gtk.object -> bool val shapeSetPathDef : Gtk.object * Gtk.object -> unit val shapeGetPathDef : Gtk.object -> Gtk.object val shapeGetType : unit -> int val polygonGetType : unit -> int val pixbufGetType : unit -> int val widgetGetType : unit -> int val reGetType : unit -> int val rectGetType : unit -> int val ellipseGetType : unit -> int val bpathGetType : unit -> int val pointsNew : int -> Gtk.object val pointsRef : Gtk.object -> Gtk.object val pointsFree : Gtk.object -> unit val getMiterPoints : real * real * real * real * real * real * real -> int * real * real * real * real val getMiterPoints' : real * real * real * real * real * real * real * real * real * real * real -> int * real * real * real * real val getButtPoints : real * real * real * real * real * int -> real * real * real * real val getButtPoints' : real * real * real * real * real * int * real * real * real * real -> real * real * real * real val polygonToPoint : int * real * real -> real * real val polygonToPoint' : real * int * real * real -> real * real val renderSvp : Gtk.object * Gtk.object * int -> unit val updateSvp : Gtk.object * Gtk.object -> Gtk.object val updateSvp' : Gtk.object * Gtk.object * Gtk.object -> Gtk.object val updateSvpClip : Gtk.object * Gtk.object * Gtk.object -> Gtk.object val updateSvpClip' : Gtk.object * Gtk.object * Gtk.object * Gtk.object -> Gtk.object val itemResetBounds : Gtk.object -> unit val itemUpdateSvp : Gtk.object * Gtk.object -> Gtk.object val itemUpdateSvp' : Gtk.object * Gtk.object * Gtk.object -> Gtk.object val itemUpdateSvpClip : Gtk.object * Gtk.object * Gtk.object -> Gtk.object val itemUpdateSvpClip' : Gtk.object * Gtk.object * Gtk.object * Gtk.object -> Gtk.object val itemRequestRedrawSvp : Gtk.object * Gtk.object -> unit val updateBbox : Gtk.object * int * int * int * int -> unit val bufEnsureBuf : Gtk.object -> unit val pointsGetType : unit -> int val pointsSetCoords : Gtk.object * int * int -> unit val itemNew : Gtk.object * int -> Gtk.object val setBackgroundColor : Gtk.object * Gtk.object -> unit val itemCreate : object * int * (string * arg) list -> object val makePoints : int list -> object end
We do not give a full documentation here. We rather recommend
to read the Porting Guide. It
gives a comprehensive overview on what has been made available.