1crosshair(n)                      Crosshairs                      crosshair(n)
2
3
4
5______________________________________________________________________________
6

NAME

8       crosshair - Crosshairs for Tk canvas
9

SYNOPSIS

11       package require Tcl  ?8.4?
12
13       package require Tk  ?8.4?
14
15       package require crosshair  ?1.0.2?
16
17       crosshair::crosshair w ?arg...?
18
19       crosshair::off w
20
21       crosshair::configure w ?arg...?
22
23       crosshair::track on w cmdprefix
24
25       crosshair::track off w
26
27______________________________________________________________________________
28

DESCRIPTION

30       The  crosshair  package  provides  commands  to  (de)activate and track
31       crosshairs on canvas widgets.
32

API

34       The following commands are exported to the public:
35
36       crosshair::crosshair w ?arg...?
37              This command activates the display of a pair of cross-hairs  for
38              the  canvas widget w. The cross-hairs track the pointing device.
39              The result of the command is the empty string.
40
41              All arguments after the widget w are treated as options as for a
42              canvas  line  item  in  w.  Of particular interest are -fill and
43              -dash.
44
45       crosshair::off w
46              This command removes the cross-hairs from the canvas  widget  w.
47              Nothing  is done if the widget had no cross-hairs. The result of
48              the command is the empty string.
49
50       crosshair::configure w ?arg...?
51              This command changes the appearance of the  cross-hairs  in  the
52              canvas  widget  w.  It is an error to call it for a canvas which
53              has no cross-hairs.
54
55              All arguments after the widget w are treated as options as for a
56              canvas  line  item  in  w.  Of particular interest are -fill and
57              -dash.
58
59              The result of the command are  the  current  configuration  set‐
60              tings.
61
62       crosshair::track on w cmdprefix
63              This  command  activates reporting of the location of the cross-
64              hairs in the canvas widget w. It is an error to use this command
65              for a canvas which has no cross-hairs. The result of the command
66              is the empty string.
67
68              After the invokation of this command the specified command  pre‐
69              fix cmdprefix will be called whenever the mouse moves within the
70              canvas, with 7 arguments. These are, in order:
71
72              [1]    The widget w
73
74              [2]    The x-location of the cross-hairs, in pixels.
75
76              [3]    The y-location of the cross-hairs, in pixels.
77
78              [4]    The x-location of the top-left corner of the viewport, in
79                     pixels.
80
81              [5]    The y-location of the top-left corner of the viewport, in
82                     pixels.
83
84              [6]    The x-location of the bottom-right corner  of  the  view‐
85                     port, in pixels.
86
87              [7]    The  y-location  of  the bottom-right corner of the view‐
88                     port, in pixels.
89
90              A previously existing callback for w will be disabled. I.e.  per
91              canvas widget with cross-hairs only one callback reporting their
92              location is possible.
93
94       crosshair::track off w
95              This command disables the  reporting  of  the  location  of  the
96              cross-hairs  in  the canvas widget w. It is an error to use this
97              command for a canvas which has no cross-hairs. The result of the
98              command is the empty string.
99

BUGS, IDEAS, FEEDBACK

101       This  document,  and the package it describes, will undoubtedly contain
102       bugs and other problems.  Please report such in the category  tklib  ::
103       crosshair     of     the    Tcllib    SF    Trackers    [http://source
104       forge.net/tracker/?group_id=12883].  Please also report any  ideas  for
105       enhancements you may have for either package and/or documentation.
106

KEYWORDS

108       canvas, cross-hairs, location, tracking, viewport
109
111       Copyright (c) 2003 Kevin Kenny
112       Copyright (c) 2008 (docs) Andreas Kupries <andreas_kupries@users.sourceforge.net>
113
114
115
116
117crosshair                            1.0.2                        crosshair(n)
Impressum