TABLE OF CONTENTS


Widgets/Canvas [ Packages ]

[ Top ] [ Widgets ] [ Packages ]

FUNCTION

 Provides code for manipulate Tk widget Canvas

SOURCE

package Tcl.Tk.Ada.Widgets.Canvas with
   SPARK_Mode
is
   pragma Elaborate_Body;

Canvas/Canvas.Tk_Canvas [ Types ]

[ Top ] [ Canvas ] [ Types ]

FUNCTION

 This is a non-abstract type derived directly from Tk_Widget.
 Each of the derived widgets redefines the Create subprogram
 in order to create the correct type of widget.

SOURCE

   type Tk_Canvas is new Tk_Widget with private;

Canvas/Canvas.Add_Tag [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Add tag to the selected items in the Tk_Canvas

SOURCE

   procedure Add_Tag
     (CanvasWidget: in Tk_Canvas; Tag, SearchSpec: in String;
      Arguments: in String := "") with
      Pre'Class => Tag /= "" and
      SearchSpec in "above" | "all" | "below" | "closest" | "enclosed" |
          "overlapping" | "withtag";

PARAMETERS

 Tag        - Tag name to add
 SearchSpec - Requirement which item must meet to be selected
 Arguments  - Arguments for the SearchSpec. Default value is empty

EXAMPLE

     -- Add tag mytag to the all items below item taged othertag in the My_Canvas canvas
     Add_Tag(My_Canvas, "mytag", "below", "othertag");

COMMANDS

 CanvasWidget addtag tag searchSpec ?arguments?

HISTORY

 8.6.3 - Added

Canvas/Canvas.BBox [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Get size of bounding box of items with the selected Tag in the
 selected Tk_Canvas

SOURCE

   function BBox
     (CanvasWidget: in Tk_Canvas; TagOrId: in String) return String with
      Pre'Class => TagOrId /= "";

PARAMETERS

 CanvasWidget - Tk_Canvas which will be queried
 Tag          - Tag or Id of items from which bounding box will be
                taken

RESULT

 Four values: x1, y1 - coordinates of starting point of bounding box
 from top left, x2, y2 - coordinates of ending point from bottom right
 of bounding box.

EXAMPLE

      -- Get the bouding box for the whole My_Canvas canvas
      Bounding_Box: constant String := BBox(My_Canvas, "all");

COMMANDS

 CanvasWidget bbox tagOrId ?tagOrId tagOrId ...?

HISTORY

 8.6.3 - Added

Canvas/Canvas.Bind_(function) [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Get information about binding to selected items in the selected
 canvas

SOURCE

   function Bind
     (CanvasWidget: in Tk_Canvas; TagOrId: in String;
      Sequence: in String := "") return String with
      Pre'Class => TagOrId /= "";

PARAMETERS

 CanvasWidget - Tk_Canvas which will be queried for the info
 TagOrId      - Tag or Id of items which will be queried for the bindings
 Sequence     - Sequence to query. Default is empty

RESULT

 If sequence is empty, return all bindings associated with the selected
 items. Otherwise, return command associated with the selected item and
 its sequence

EXAMPLE

      -- Get the all binding associated with the mytag tag in the My_Canvas canvas
      Bindings: constant String := Bind(My_Canvas, "mytag");

SEE ALSO

 Canvas.Bind_(procedure)

COMMANDS

 CanvasWidget bind tagOrId ?sequence?

HISTORY

 8.6.3 - Added

Canvas/Canvas.Bind_(procedure) [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Bind the selected command to the selected item in the selected canvas
 with the selected sequence

SOURCE

   procedure Bind
     (CanvasWidget: in Tk_Canvas; TagOrId, Sequence, Command: in String) with
      Pre'Class => TagOrId /= "" and Sequence /= "" and Command /= "";

PARAMETERS

 CanvasWidget - Tk_Canvas in which bind will be done
 TagOrId      - Tag or Id of items to which bind will be done
 Sequence     - Sequence to which command will be bound
 Command      - Tcl command which will be bound

EXAMPLE

      -- Bind the command exit to the tag mytag in My_Canvas at left mouse button click
      Bind(My_Canvas, "mytag", "<1>", "exit");

SEE ALSO

 Canvas.Bind_(function)

COMMANDS

 CanvasWidget bind tagOrId sequence command

HISTORY

 8.6.3 - Added

Canvas/Canvas.Canvas_Create_(function) [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Add the child to the canvas

SOURCE

   function Canvas_Create
     (Parent: in Tk_Canvas; Child_Type: in String; Options: in String := "")
      return String with
      Pre'Class => Child_Type /= "";

PARAMETERS

 Parent     - Tk_Canvas to which child will be added
 Child_Type - Tk type of child to add
 Options    - Tk options to create command

RESULT

 Id of the newly created window

EXAMPLE

      -- Add button My_Button as a window to My_Canvas canvas at (0,0) point and get it Id
      Button_Id := constant Sttring := Canvas_Create(My_Canvas, "window", "0 0 -window " & My_Button);

SEE ALSO

 Canvas.Canvas_Create_(procedure)

COMMANDS

 CanvasWidget create type ?options?

HISTORY

 8.6.6 - Added

Canvas/Canvas.Canvas_Create_(procedure) [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Add the child to the canvas

SOURCE

   procedure Canvas_Create
     (Parent: in Tk_Canvas; Child_Type: in String;
      Options: in String := "") with
      Pre'Class => Child_Type /= "";

PARAMETERS

 Parent     - Tk_Canvas to which child will be added
 Child_Type - Tk type of child to add
 Options    - Tk options to create command

EXAMPLE

      -- Add button My_Button as a window to My_Canvas canvas at (0,0) point
      Canvas_Create(My_Canvas, "window", "0 0 -window " & My_Button);

SEE ALSO

 Canvas.Canvas_Create_(function)

COMMANDS

 CanvasWidget create type ?options?

HISTORY

 8.6.3 - Added

Canvas/Canvas.Canvas_Raise [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Move selected item higher in the display

SOURCE

   procedure Canvas_Raise
     (CanvasWidget: in Tk_Canvas; TagOrId: in String;
      AboveThis: in String := "") with
      Pre'Class => TagOrId /= "";

PARAMETERS

 CanvasWidget - Tk_Canvas in which items will be moved
 TagOrId      - Tag or Id of the items to move. If refers to more than
                one item, all items will be moved but they relative
                order will be preserved
 AboveThis    - Tag or Id of the item above which selected items will
                be moved. Default value is empty

EXAMPLE

      -- Move items tagged with mytag higher in My_Canvas canvas
      Canvas_Raise(My_Canvas, "mytag");

COMMANDS

 CanvasWidget raise tagOrId ?aboveThis?

HISTORY

 8.6.3 - Added

Canvas/Canvas.Canvas_Type [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Get type of the selected item in the selected Tk_Canvas

SOURCE

   function Canvas_Type
     (CanvasWidget: in Tk_Canvas; TagOrId: in String) return String with
      Pre'Class => TagOrId /= "";

PARAMETERS

 CanvasWidget - Tk_Canvas in which item's type will be queried
 TagOrId      - Tag or Id of the item from which type will be get

RESULT

 Type of the selected item. If TagOrId refers to more than one item,
 return type of the first item. If no item with the selected TagOrId,
 return {}

EXAMPLE

      -- Get the type of the item tagged mytag in My_Canvas canvas
      Item_Type: constant String := Canvas_Type(My_Canvas, "mytag");

COMMANDS

 CanvasWidget type tagOrId

HISTORY

 8.6.3 - Added

Canvas/Canvas.CanvasX [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Get canvas X coordinate for the selected screen X coordinate

SOURCE

   function CanvasX
     (CanvasWidget: in Tk_Canvas; ScreenX: in String;
      GridSpacing: in String := "") return String with
      Pre'Class => ScreenX /= "";

PARAMETERS

 CanvasWidget - Tk_Canvas which will be queried for X coordinate
 ScreenX      - Screen X coordinate which will be looking for in the
                CanvasWidget
 GridSpacing  - If specified, round result to nearest multiple of
                GridSpacing units. Default is empty

RESULT

 Canvas X coordinate for the selected screen X coordinate

EXAMPLE

      -- Get the X coordinate for screen X coordinate 14 at My_Canvas canvas
      X: constant String := CanvasX(My_Canvas, "14");

COMMANDS

 CanvasWidget canvasx screenx ?gridspacing?

HISTORY

 8.6.3 - Added

Canvas/Canvas.CanvasY [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Get canvas Y coordinate for the selected screen Y coordinate

SOURCE

   function CanvasY
     (CanvasWidget: in Tk_Canvas; ScreenY: in String;
      GridSpacing: in String := "") return String with
      Pre'Class => ScreenY /= "";

PARAMETERS

 CanvasWidget - Tk_Canvas which will be queried for Y coordinate
 ScreenX      - Screen Y coordinate which will be looking for in the
                CanvasWidget
 GridSpacing  - If specified, round result to nearest multiple of
                GridSpacing units. Default is empty

RESULT

 Canvas Y coordinate for the selected screen Y coordinate

EXAMPLE

      -- Get the Y coordinate for screen Y coordinate 23 at My_Canvas canvas
      Y: constant String := CanvasX(My_Canvas, "23");

COMMANDS

 CanvasWidget canvasy screeny ?gridspacing?

HISTORY

 8.6.3 - Added

Canvas/Canvas.Coords_(function) [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Get coordinates for the selected widgets inside the selected Tk_Canvas

SOURCE

   function Coords
     (CanvasWidget: in Tk_Canvas; TagOrId: in String) return String with
      Pre'Class => TagOrId /= "";

PARAMETERS

 CanvasWidget - Tk_Canvas in which the widgets will be queried
 TagOrId      - Tag or Id of the items which will be queried.

RESULT

 List with coordinates of the selected items

EXAMPLE

      -- Get the coordinates of the mytag tag in My_Canvas canvas
      Coorditates: constant String := Coords(My_Canvas, "mytag");

SEE ALSO

 Canvas.Coords_(procedure)

COMMANDS

 CanvasWidget coords tagOrId

HISTORY

 8.6.3 - Added

Canvas/Canvas.Coords_(procedure) [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Set new coordinates for the selected widget inside the selected
 Tk_Canvas

SOURCE

   procedure Coords
     (CanvasWidget: in Tk_Canvas; TagOrId, Coordinates: in String) with
      Pre'Class => TagOrId /= "" and Coordinates /= "";

PARAMETERS

 CanvasWidget - Tk_Canvas in which the widget will be moved
 TagOrId      - Tag or Id of the item which will be moved. If Tag
                refers to multiple items, only first will be used.
 Coordinates  - New coordinates for the item

EXAMPLE

      -- Set the coordinate for mytag item in My_Canvas canvas to (23, 56)
      Coords(My_Canvas, "mytag", " 23 56");

SEE ALSO

 Canvas.Coords_(function)

COMMANDS

 CanvasWidget coords tagOrId x y

HISTORY

 8.6.3 - Added

Canvas/Canvas.Create_(function) [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Creates a new Tk_Canvas in the specified interpreter.

SOURCE

   overriding function Create
     (pathName: in String; options: in String := "";
      Interp: in Tcl_Interp := Null_Interp) return Tk_Canvas with
      Global => null;

PARAMETERS

 pathName - Tk path (starts with dot) for the widget
 options  - Options which will be passed to the widget. Default value is
            empty
 Interp   - Tcl interpreter to which the widget will be created. If null,
            the widget will be created in the "contextual" interpreter.
            Default value is null.

RESULT

 Newly created Tk_Canvas

EXAMPLE

   -- Create a new canvas with pathname .mycanvas
   My_Canvas: constant Tk_Canvas := Create(".mycanvas");

SEE ALSO

 Canvas.Create_(procedure)

COMMANDS

 canvas pathName ?options?

HISTORY

 8.6.1 - Added

Canvas/Canvas.Create_(procedure) [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Creates a new Tk_Canvas in the specified interpreter.

SOURCE

   overriding procedure Create
     (Widgt: out Tk_Canvas; pathName: in String; options: in String := "";
      Interp: in Tcl_Interp := Null_Interp) with
      Global => null;

PARAMETERS

 Widgt    - Tk_Canvas which will be created
 pathName - Tk path (starts with dot) for the widget
 options  - Options which will be passed to the widget. Default value is
            empty
 Interp   - Tcl interpreter to which the widget will be created. If null,
            the widget will be created in the "contextual" interpreter.
            Default value is null.

OUTPUT

 Newly created Tk_Canvas as parameter Widgt

EXAMPLE

     -- Create canvas My_Canvas with pathname .mycanvas and with black background on the current Tcl interpreter
     declare
        My_Canvas: Tk_Canvas;
     begin
        Create(My_Canvas, ".mycanvas", "-background black");
     end;

SEE ALSO

 Canvas.Create_(function)

COMMANDS

 canvas pathName ?options?

HISTORY

 8.6.1 - Added

Canvas/Canvas.Dchars [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Delete characters in the selected items in the selected range

SOURCE

   procedure Dchars
     (CanvasWidget: in Tk_Canvas; TagOrId, First: in String;
      Last: in String := "") with
      Pre'Class => TagOrId /= "" and First /= "";

PARAMETERS

 CanvasWidget - Tk_Canvas in which characters will be deleted
 TagOrId      - Tag or Id of the items in which characters will be
                deleted
 First        - Index or coordinates where to start deleting characters
 Last         - Index or coordinates where to end deleting characters.
                Default value is empty

EXAMPLE

      -- Delete characters in tag mytag from first to 10th in My_Canvas canvas
      Dchars(My_Canvas, "mytag", "0", "9");

COMMANDS

 CanvasWidget dchars tagOrId first ?last?

HISTORY

 8.6.3 - Added

Canvas/Canvas.Delete [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Delete selected items from the selected canvas

SOURCE

   procedure Delete(CanvasWidget: in Tk_Canvas; TagOrId: in String) with
      Pre'Class => TagOrId /= "";

PARAMETERS

 CanvasWidget - Tk_Canvas in which items will be deleted
 TagOrId      - Tag or Id of the items to delete

EXAMPLE

      -- Delete item tagged "mytag" from the My_Canvas canvas
      Delete(My_Canvas, "mytag");

COMMANDS

 CanvasWidget delete ?tagOrId tagOrId ...?

HISTORY

 8.6.3 - Added

Canvas/Canvas.DTag [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Delete selected Tag from items in the selected canvas

SOURCE

   procedure DTag
     (CanvasWidget: in Tk_Canvas; TagOrId: in String;
      TagToDelete: in String := "") with
      Pre'Class => TagOrId /= "";

PARAMETERS

 CanvasWidget - Tk_Canvas in which tag will be deleted
 TagOrId      - Tag or Id of items from which tag will be deleted
 TagToDelete  - Tag to delete. If empty, delete value of parameter
                TagOrId. Default value is empty

EXAMPLE

      -- Delete tag "mytag" from the all items in the My_Canvas canvas
      DTag(My_Canvas, "all", "mytag");

COMMANDS

 CanvasWidget dtag tagOrId ?tagToDelete?

HISTORY

 8.6.3 - Added

Canvas/Canvas.Find [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Find items in the selected canvas

SOURCE

   function Find
     (CanvasWidget: in Tk_Canvas; SearchCommand: in String;
      Arguments: in String := "") return String with
      Pre'Class => SearchCommand /= "";

PARAMETERS

 CanvasWidget  - Tk_Canvas which will be queried for items
 SearchCommand - Search criteria for items. It is that same as
                 SearchSpec for Add_Tag procedure.
 Arguments    - Arguments for SearchCommand. Must be that same as
                 arguments for Add_Tag procedure. Default value is
                 empty

RESULT

 List of items in the stacking order, the lowest item first

EXAMPLE

      -- Find items above item tagged as mytag in the My_Canvas canvas
      Items: constant String := Find(My_Canvas, "above", "mytag");

COMMANDS

 CanvasWidget find searchCommand ?arguments?

HISTORY

 8.6.3 - Added

Canvas/Canvas.Focus [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Set focused item in the selected canvas

SOURCE

   procedure Focus(CanvasWidget: in Tk_Canvas; TagOrId: in String := "");

PARAMETERS

 CanvasWidget - Tk_Canvas in which focus will be set
 TagOrId      - Tag or Id of item to set as focused item. If few items
                are with this same tag, only first will be used. If no
                item with that tag or TagOrId is empty, reset focus.
                Default value is empty

EXAMPLE

      -- Set the focus in the My_Canvas canvas to item tagged "mytag"
      Focus(My_Canvas, "mytag");

COMMANDS

 CanvasWidget focus ?tagOrId?

HISTORY

 8.6.3 - Added

Canvas/Canvas.Get_Tags [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Get list of tags associated with the selected element in the selected
 canvas

SOURCE

   function Get_Tags
     (CanvasWidget: in Tk_Canvas; TagOrId: in String) return String with
      Pre'Class => TagOrId /= "";

PARAMETERS

 CanvasWidget - Tk_Canvas in which elements will be queried
 TagOrId      - Tag or Id of element from which get tags

RESULT

 List of tags associated with the selected TagOrId. If there is more than
 one element in the CanvasWidget, return tags for the first element in
 the list. If there no element with that TagOrId or element don't have
 any tag, return empty string

EXAMPLE

   -- Get the list of tags associated with the item tagged "mytag" in the canvas My_Canvas
   Tags: constant String := Get_Tags(My_Canvas, "mytag");

COMMANDS

 CanvasWidget gettags tagOrId

HISTORY

 8.6.3 - Added

Canvas/Canvas.Get_Widget [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Get the existing Tk_Canvas widget

SOURCE

   overriding function Get_Widget
     (pathName: in String; Interp: in Tcl_Interp := Get_Context)
      return Tk_Canvas with
      Global => null;

PARAMETERS

 pathName - Tk path (starts with dot) for the widget
 Interp   - Tcl interpreter on which the widget exists. Can be empty.
            Default value is current Tcl interpreter

RESULT

 Existing Tk_Canvas widget

EXAMPLE

     -- Get canvas widget with name .mycanvas on the current Tcl interpreter
     My_Canvas: constant Tk_Canvas := Get_Widget(".mycanvas");

HISTORY

 8.6.9 - Added

Canvas/Canvas.ICursor [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Set insertion cursor in the selected element on selected position

SOURCE

   procedure ICursor
     (CanvasWidget: in Tk_Canvas; TagOrId, Index: in String) with
      Pre'Class => TagOrId /= "" and Index /= "";

PARAMETERS

 CanvasWidget - Tk_Canvas in which insertion cursor will be set
 TagOrId      - Tag or Id of the element in which insertion cursor
                will be set. If some or all elements specified by
                Tag or Id don't support an insertion cursor, this
                procedure do nothing
 Index        - Index in characters before which an insertion cursor
                will be insererted

EXAMPLE

      -- Set the insertion cursor to start in the item tagged mytag in canvas My_Canvas
      ICursor(My_Canvas, "mytag", "0");

COMMANDS

 CanvasWidget icursor tagOrId index

HISTORY

 8.6.3 - Added

Canvas/Canvas.IMove [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Move index'th coordinate of the selected items to a new location

SOURCE

   procedure IMove
     (CanvasWidget: in Tk_Canvas; TagOrId, Index, X, Y: in String) with
      Pre'Class => TagOrId /= "" and Index /= "" and X /= "" and Y /= "";

PARAMETERS

 CanvasWidget - Tk_Canvas in which items will be queried
 TagOrId      - Tag or Id of items which coordinates will be moved
 Index        - Index of coordinate to move. Each item interprets this
                value independently
 X            - A new X coordinate
 Y            - A new Y coordinate

EXAMPLE

      -- Move first index in the mytag tagged item in My_Canvas canvas to position (15, 89)
      IMove(My_Canvas, "mytag", "0", "15", "89");

COMMANDS

 CanvasWidget imove tagOrId index x y

HISTORY

 8.6.3 - Added

Canvas/Canvas.Index [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Get numerical index of the selected Index in the selected items

SOURCE

   function Index
     (CanvasWidget: in Tk_Canvas; TagOrId, Index: in String) return String with
      Pre'Class => TagOrId /= "" and Index /= "";

PARAMETERS

 CanvasWidget - Tk_Canvas in which index will be queried
 TagOrId      - Tag or Id of items to query for index
 Index        - Depends on the item, it can be coordinate or index of
                character in textual description

RESULT

 Numerical index of the selected Index in the selected items

EXAMPLE

      -- Get the index of the first index in mytag tagged item in My_Canvas canvas
      My_Index: constant String := Index(My_Canvas, "mytag", "0");

COMMANDS

 CanvasWidget index tagOrId index

HISTORY

 8.6.3 - Added

Canvas/Canvas.Insert [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Insert item in the elements in the selected canvas

SOURCE

   procedure Insert
     (CanvasWidget: in Tk_Canvas; TagOrId, BeforeThis, Item: in String) with
      Pre'Class => TagOrId /= "" and BeforeThis /= "" and Item /= "";

PARAMETERS

 CanvasWidget - Tk_Canvas in which items will be modified
 TagOrId      - Tag or Id of the elements in which Item will be
                inserted
 BeforeThis   - Insert Item before this value. For text elements, it
                will be character number, for lines, polygons
                coordinates
 Item         - Text to insert to the selected elements

EXAMPLE

      -- Insert hello world text at 10th character to all items tagged mytag in My_Canvas canvas
      Insert(My_Canvas, "mytag", "9", "hello world");

COMMANDS

 CanvasWidget insert tagOrId beforeThis item

HISTORY

 8.6.3 - Added

Canvas/Canvas.Item_Cget [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Get configuration option for the selected item in the selected canvas

SOURCE

   function Item_Cget
     (CanvasWidget: in Tk_Canvas; TagOrId, Option: in String)
      return String with
      Pre'Class => TagOrId /= "" and Option /= "";

PARAMETERS

 CanvasWidget - Tk_Canvas which will be queried for option
 TagOrId      - Tag or Id of the item which will be queried for option
 Option       - Tk option to query

RESULT

 Current value of the selected option of the selected item. If TagOrId
 refers to more than one item, only first item is checked.

EXAMPLE

      -- Get the text from the item tagged mytag in My_Canvas canvas
      Text: constant String := Item_Cget(My_Canvas, "mytag", "-text");

COMMANDS

 CanvasWidget itemcget tagOrId option

HISTORY

 8.6.3 - Added

Canvas/Canvas.Item_Configure_(function) [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Queries or modifies the configuration options of the selected item

SOURCE

   function Item_Configure
     (CanvasWidget: in Tk_Canvas; TagOrId: in String; Options: in String := "")
      return String with
      Pre'Class => TagOrId /= "";

PARAMETERS

 CanvasWidget - Tk_Canvas which will be queried or modified for options
 TagOrId      - Tag or Id of the item which will be queried or modified
                for options
 Options      - Options to modify or get.

RESULT

 If Options is empty, return all available options and their values for
 the selected item. Otherwise, return selected option's value for the
 selected item

EXAMPLE

      -- Get the text of the item tagged mytag in My_Canvas canvas
      Text: constant String := Item_Configure(My_Canvas, "mytag", "-text");

SEE ALSO

 Canvas.Item_Configure_(procedure)

COMMANDS

 CanvasWidget itemconfigure tagOrId ?options?

HISTORY

 8.6.3 - Added

Canvas/Canvas.Item_Configure_(procedure) [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Modify the configuration options of the selected item

SOURCE

   procedure Item_Configure
     (CanvasWidget: in Tk_Canvas; TagOrId, Options: in String) with
      Pre'Class => TagOrId /= "" and Options /= "";

PARAMETERS

 CanvasWidget - Tk_Canvas in which options will be modified
 TagOrId      - Tag or Id of the item which options will be modified
 Options      - Options to modify with values for them.

EXAMPLE

      -- Set the text to hello world in item tagged mytag in My_Canvas canvas
      Item_Configure(My_Canvas, "mytag", "-text {hello world}");

SEE ALSO

 Canvas.Item_Configure_(function)

COMMANDS

 CanvasWidget itemconfigure tagOrId options

HISTORY

 8.6.3 - Added

Canvas/Canvas.Lower [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Move selected item lower in the display

SOURCE

   procedure Lower
     (CanvasWidget: in Tk_Canvas; TagOrId: in String;
      BelowThis: in String := "") with
      Pre'Class => TagOrId /= "";

PARAMETERS

 CanvasWidget - Tk_Canvas in which items will be moved
 TagOrId      - Tag or Id of the items to move. If refers to more than
                one item, all items will be moved but they relative
                order will be preserved
 BelowThis    - Tag or Id of the item below which selected items will
                be moved. Default value is empty

EXAMPLE

      -- Move items tagged mytag in My_Canvas canvas
      Lower(My_Canvas, "mytag");

COMMANDS

 CanvasWidget lower tagOrId ?belowThis?

HISTORY

 8.6.3 - Added

Canvas/Canvas.Move [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Move selected items in the canvas coodinate space

SOURCE

   procedure Move
     (CanvasWidget: in Tk_Canvas; TagOrId, XAmount, YAmount: in String) with
      Pre'Class => TagOrId /= "" and XAmount /= "" and YAmount /= "";

PARAMETERS

 CanvasWidget - Tk_Canvas in which items will be moved
 TagOrId      - Tag or Id of the items to move
 XAmount      - Amount to add to X coordinate of the items
 YAmount      - Amount to add to Y coordinate of the items

EXAMPLE

      -- Move items tagged mytag in My_Canvas canvas by 10px in X and 14px in Y
      Move(My_Canvas, "mytag", "10", "14");

COMMANDS

 CanvasWidget move tagOrId xAmount yAmount

HISTORY

 8.6.3 - Added

Canvas/Canvas.MoveTo [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Move selected items to the selected position in the selected canvas

SOURCE

   procedure MoveTo
     (CanvasWidget: in Tk_Canvas; TagOrId, XPos, YPos: in String) with
      Pre'Class => XPos /= "" and YPos /= "";

PARAMETERS

 CanvasWidget - Tk_Canvas in which items will be moved
 TagOrId      - Tag or Id of the item to move
 XPos         - A new X coordinate of the items
 YPos         - A new Y coordinate of the items

EXAMPLE

      -- Move all items tagged mytag in My_Canvas to point (24, 42)
      MoveTo(My_Canvas, "mytag", "24", "42");

COMMANDS

 CanvasWidget moveto tagOrId xPos yPos

HISTORY

 8.6.3 - Added

Canvas/Canvas.Postscript [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Generate a Postscript representation of part or all of the canvas

SOURCE

   function Postscript
     (CanvasWidget: in Tk_Canvas; Options: in String) return String with
      Pre'Class => Options /= "";

PARAMETERS

 CanvasWidget - Tk_Canvas which Postscrip representation will be
                created
 Options      - Additional options passed to the command

RESULT

 A Postscript representation of the CanvasWidget or empty string if
 representation was selected to write to file

EXAMPLE

      -- Save all the My_Canvas canvas to the file mycanvas.ps
      Postscript(My_Canvas, "-file mycanvas.ps");

COMMANDS

 CanvasWidget postscript options

HISTORY

 8.6.3 - Added

Canvas/Canvas.Rchars [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Replace text at selected position in the selected items. How text is
 replaced depends on the item type

SOURCE

   procedure Rchars
     (CanvasWidget: in Tk_Canvas; TagOrId, First, Last, Text: in String) with
      Pre'Class => TagOrId /= "" and First /= "" and Last /= "" and Text /= "";

PARAMETERS

 CanvasWidget - Tk_Canvas in which items text will be replaced
 TagOrId      - Tag or Id of the items in which text will be replaced
 First        - Character position or coordinate at which replace text
                starts
 Last         - Character position or coordinate at which replace text
                ends
 Text         - Text to replace

EXAMPLE

      -- Replace text in items tagged mytag between first and third character with text hello world in My_Canvas
      Rchars(My_Canvas, "mytag", "0", "2", "{hello world}");

COMMANDS

 CanvasWidget rchars tagOrId first last Text

HISTORY

 8.6.3 - Added

Canvas/Canvas.Scale [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Rescale coordinates of the selected items in canvas coordinate space.
 Each point is scaled by distance between XOrgin and XScale and YOrgin
 and YScale respectively.

SOURCE

   procedure Scale
     (CanvasWidget: in Tk_Canvas;
      TagOrId, XOrgin, YOrgin, XScale, YScale: in String) with
      Pre'Class => TagOrId /= "" and XOrgin /= "" and YOrgin /= "" and
      XScale /= "" and YScale /= "";

PARAMETERS

 CanvasWidget - Tk_Canvas in which items will be scaled
 TagOrId      - Tag or Id of the items to scale
 XOrgin       - X coordinate of the scale starting point
 YOrgin       - Y coordinate of the scale starting point
 XScale       - X factor to scale points. 1.0 mean no scaling
 YScale       - Y factor to scale points. 1.0 mean no scaling

EXAMPLE

      -- Scale all items tagged mytag in My_Canvas canvas from point (34, 54) by 0.5 in both dimensions
      Scale(My_Canvas, "mytag", "34", "54", "0.5", "0.5");

COMMANDS

 CanvasWidget scale tagOrId xOrigin yOrigin xScale yScale

HISTORY

 8.6.3 - Added

Canvas/Canvas.Select_Adjust [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Resize current selection in the item in canvas to the selected index

SOURCE

   procedure Select_Adjust
     (CanvasWidget: in Tk_Canvas; TagOrId, Index: in String) with
      Pre'Class => TagOrId /= "" and Index /= "";

PARAMETERS

 CanvasWidget - Tk_Canvas in which selection will be resized
 TagOrId      - Tag or Id of the item in which selection will be
                resized
 Index        - New index to which selection will be done in the item

EXAMPLE

      -- Resize selection to 10th index in item tagged mytag in My_Canvas canvas
      Select_Adjust(My_Canvas, "mytag", "9");

COMMANDS

 CanvasWidget select adjust tagOrId index

HISTORY

 8.6.3 - Added

Canvas/Canvas.Select_Clear [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Clear the selection in the selected Tk_Canvas

SOURCE

   procedure Select_Clear(CanvasWidget: in Tk_Canvas);

PARAMETERS

 CanvasWidget - Tk_Canvas in which selection will be cleared

EXAMPLE

      -- Clear selection in My_Canvas canvas
      Select_Clear(My_Canvas);

COMMANDS

 CanvasWidget select clear

HISTORY

 8.6.3 - Added

Canvas/Canvas.Select_From [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Set the selection anchor point for the canvas in the selected item at
 selected character. This procedure does not change selection it just
 set fixed end selection for future Select_To procedure

SOURCE

   procedure Select_From
     (CanvasWidget: in Tk_Canvas; TagOrId, Index: in String) with
      Pre'Class => TagOrId /= "" and Index /= "";

PARAMETERS

 CanvasWidget - Tk_Canvas in which the selection will be set
 TagOrId      - Tag or Id of the item in which the selection will be set
 Index        - Index of character before which the selection will be set

EXAMPLE

   -- Set the selection anchor point at first index in item tagged mytag in My_Canvas canvas
   Select_From(My_Canvas, "mytag", "0");

COMMANDS

 CanvasWidget select from tagOrId index

HISTORY

 8.6.3 - Added

Canvas/Canvas.Select_Item [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Get Id of the selected item in the selected canvas

SOURCE

   function Select_Item(CanvasWidget: in Tk_Canvas) return String;

PARAMETERS

 CanvasWidget - Tk_Canvas in which selection will be queried

RESULT

 Id of the selected item or {} if no item selected in the CanvasWidget

EXAMPLE

      -- Get the Id of the selected item in My_Canvas canvas
      Item_Id: constant String := Select_Item(My_Canvas);

COMMANDS

 CanvasWidget select item

HISTORY

 8.6.3 - Added

Canvas/Canvas.Select_To [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Set selection end for the canvas in the selected item at the selected
 character. Starting point is set by the most recent Select_Adjust or
 Select_From procedures

SOURCE

   procedure Select_To
     (CanvasWidget: in Tk_Canvas; TagOrId, Index: in String) with
      Pre'Class => TagOrId /= "" and Index /= "";

PARAMETERS

 CanvasWidget - Tk_Canvas in which selection will be set
 TagOrId      - Tag or Id of the item in which selection will be set
 Index        - Index of character which will be added to the selection

EXAMPLE

   -- Set the end of the selection to 10th index in mytag tagged item in My_Canvas canvas
   Select_To(My_Canvas, "mytag", "9");

COMMANDS

 CanvasWidget select to tagOrId index

HISTORY

 8.6.3 - Added

Canvas/Canvas.XView [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Get which horizontal fraction of the canvas is visible

SOURCE

   function XView(CanvasWidget: in Tk_Canvas) return String;

PARAMETERS

 CanvasWidget - Tk_Canvas which will be queried for visibility

RESULT

 Pair of elements: first element is the start of horizontal fraction of
 the CanvasWidget which is visible, second is the end of horizontal
 fraction of the CanvasWidget which is visible.

EXAMPLE

      -- Get the horizontal fraction of the My_Canvas canvas
      Horizontal_Fraction: constant String := XView(My_Canvas);

SEE ALSO

 Canvas.YView

COMMANDS

 CanvasWidget xview

HISTORY

 8.6.3 - Added

Canvas/Canvas.Xview_Move_To [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Adjusts the view in the window so that fraction of the total width of
 the Tk_Canvas is off-screen to the left.

SOURCE

   procedure Xview_Move_To
     (CanvasWidget: in Tk_Canvas; Fraction: in String) with
      Pre'Class => Fraction /= "";

PARAMETERS

 CanvasWidget - Tk_Canvas which view will be adjusted
 Fraction     - Fraction of the CanvasWidget to move. Must be between 0
                and 1

EXAMPLE

   -- Show the first half of the canvas My_Canvas
   Xview_Move_To(My_Canvas, "0.5");

SEE ALSO

 Canvas.Yview_Move_To

COMMANDS

 CanvasWidget xview moveto fraction

HISTORY

 8.6.3 - Added

Canvas/Canvas.Xview_Scroll [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Shift the view in the window on left or right according to Number and
 What.

SOURCE

   procedure Xview_Scroll
     (CanvasWidget: in Tk_Canvas; Number, What: in String) with
      Pre'Class => Number /= "" and (What = "units" or What = "pages");

PARAMETERS

 CanvasWidget - Tk_Canvas which view will be shifted
 Number       - The amount of What to shift the CanvasWidget
 What         - Type of amount to move. Can be "units" or "pages"

EXAMPLE

      -- Move the view in the My_Canvas canvas by 10 units to right
      Xview_Scroll(My_Canvas, "10", "units");

SEE ALSO

 Canvas.Yview_Scroll

COMMANDS

 CanvasWidget xview scroll number what

HISTORY

 8.6.4 - Added

Canvas/Canvas.YView [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Get which vertical fraction of the canvas is visible

SOURCE

   function YView(CanvasWidget: in Tk_Canvas) return String;

PARAMETERS

 CanvasWidget - Tk_Canvas which will be queried for visibility

RESULT

 Pair of elements: first element is the start of vertical fraction of
 the CanvasWidget which is visible, second is the end of vertical
 fraction of the CanvasWidget which is visible.

EXAMPLE

      -- Get the vertical fraction of the My_Canvas canvas
      Vertical_Fraction: constant String := YView(My_Canvas);

SEE ALSO

 Canvas.XView

COMMANDS

 CanvasWidget yview

HISTORY

 8.6.4 - Added

Canvas/Canvas.Yview_Move_To [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Adjusts the view in the window so that fraction of the total height of
 the Tk_Canvas is off-screen to the top.

SOURCE

   procedure Yview_Move_To
     (CanvasWidget: in Tk_Canvas; Fraction: in String) with
      Pre'Class => Fraction /= "";

PARAMETERS

 CanvasWidget - Tk_Canvas which view will be adjusted
 Fraction     - Fraction of the CanvasWidget to move. Must be between 0
                and 1

EXAMPLE

   -- Show the first half of the canvas My_Canvas
   Yview_Move_To(My_Canvas, "0.5");

SEE ALSO

 Canvas.Xview_Move_To

COMMANDS

 CanvasWidget yview moveto fraction

HISTORY

 8.6.4 - Added

Canvas/Canvas.Yview_Scroll [ Subprograms ]

[ Top ] [ Canvas ] [ Subprograms ]

FUNCTION

 Shift the view in the window on top or bottom according to Number and
 What.

SOURCE

   procedure Yview_Scroll
     (CanvasWidget: in Tk_Canvas; Number, What: in String) with
      Pre'Class => Number /= "" and (What = "units" or What = "pages");

PARAMETERS

 CanvasWidget - Tk_Canvas which view will be shifted
 Number       - The amount of What to shift the CanvasWidget
 What         - Type of amount to move. Can be "units" or "pages"

EXAMPLE

      -- Move the view in the My_Canvas canvas by 10 units to top
      Yview_Scroll(My_Canvas, "-10", "units");

SEE ALSO

 Canvas.Xview_Scroll

COMMANDS

 CanvasWidget yview scroll number what

HISTORY

 8.6.4 - Added