OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [tk/] [doc/] [CanvTxtInfo.3] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
'\"
2
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
3
'\"
4
'\" See the file "license.terms" for information on usage and redistribution
5
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
6
'\"
7
'\" RCS: @(#) $Id: CanvTxtInfo.3,v 1.1.1.1 2002-01-16 10:25:48 markom Exp $
8
'\"
9
.so man.macros
10
.TH Tk_CanvasTextInfo 3 4.0 Tk "Tk Library Procedures"
11
.BS
12
.SH NAME
13
Tk_CanvasTextInfo \- additional information for managing text items in canvases
14
.SH SYNOPSIS
15
.nf
16
\fB#include \fR
17
.sp
18
Tk_CanvasTextInfo *
19
\fBTk_CanvasGetTextInfo\fR(\fIcanvas\fR)
20
.SH ARGUMENTS
21
.AS Tk_Canvas canvas
22
.AP Tk_Canvas canvas in
23
A token that identifies a particular canvas widget.
24
.BE
25
 
26
.SH DESCRIPTION
27
.PP
28
Textual canvas items are somewhat more complicated to manage than
29
other items, due to things like the selection and the input focus.
30
\fBTk_CanvasGetTextInfo\fR may be invoked by a type manager
31
to obtain additional information needed for items that display text.
32
The return value from \fBTk_CanvasGetTextInfo\fR is a pointer to
33
a structure that is shared between Tk and all the items that display
34
text.
35
The structure has the following form:
36
.CS
37
typedef struct Tk_CanvasTextInfo {
38
        Tk_3DBorder \fIselBorder\fR;
39
        int \fIselBorderWidth\fR;
40
        XColor *\fIselFgColorPtr\fR;
41
        Tk_Item *\fIselItemPtr\fR;
42
        int \fIselectFirst\fR;
43
        int \fIselectLast\fR;
44
        Tk_Item *\fIanchorItemPtr\fR;
45
        int \fIselectAnchor\fR;
46
        Tk_3DBorder \fIinsertBorder\fR;
47
        int \fIinsertWidth\fR;
48
        int \fIinsertBorderWidth\fR;
49
        Tk_Item *\fIfocusItemPtr\fR;
50
        int \fIgotFocus\fR;
51
        int \fIcursorOn\fR;
52
} Tk_CanvasTextInfo;
53
.CE
54
The \fBselBorder\fR field identifies a Tk_3DBorder that should be
55
used for drawing the background under selected text.
56
\fIselBorderWidth\fR gives the width of the raised border around
57
selected text, in pixels.
58
\fIselFgColorPtr\fR points to an XColor that describes the foreground
59
color to be used when drawing selected text.
60
\fIselItemPtr\fR points to the item that is currently selected, or
61
NULL if there is no item selected or if the canvas doesn't have the
62
selection.
63
\fIselectFirst\fR and \fIselectLast\fR give the indices of the first
64
and last selected characters in \fIselItemPtr\fR, as returned by the
65
\fIindexProc\fR for that item.
66
\fIanchorItemPtr\fR points to the item that currently has the selection
67
anchor;  this is not necessarily the same as \fIselItemPtr\fR.
68
\fIselectAnchor\fR is an index that identifies the anchor position
69
within \fIanchorItemPtr\fR.
70
\fIinsertBorder\fR contains a Tk_3DBorder to use when drawing the
71
insertion cursor;  \fIinsertWidth\fR gives the total width of the
72
insertion cursor in pixels, and \fIinsertBorderWidth\fR gives the
73
width of the raised  border around the insertion cursor.
74
\fIfocusItemPtr\fR identifies the item that currently has the input
75
focus, or NULL if there is no such item.
76
\fIgotFocus\fR is 1 if the canvas widget has the input focus and
77
 
78
\fIcursorOn\fR is 1 if the insertion cursor should be drawn in
79
\fIfocusItemPtr\fR and 0 if it should not be drawn;  this field
80
is toggled on and off by Tk to make the cursor blink.
81
.PP
82
The structure returned by \fBTk_CanvasGetTextInfo\fR
83
is shared between Tk and the type managers;  typically the type manager
84
calls \fBTk_CanvasGetTextInfo\fR once when an item is created and
85
then saves the pointer in the item's record.
86
Tk will update information in the Tk_CanvasTextInfo;  for example,
87
a \fBconfigure\fR widget command might change the \fIselBorder\fR
88
field, or a \fBselect\fR widget command might change the \fIselectFirst\fR
89
field, or Tk might change \fIcursorOn\fR in order to make the insertion
90
cursor flash on and off during successive redisplays.
91
.PP
92
Type managers should treat all of the fields of the Tk_CanvasTextInfo
93
structure as read-only, except for \fIselItemPtr\fR, \fIselectFirst\fR,
94
\fIselectLast\fR, and \fIselectAnchor\fR.
95
Type managers may change \fIselectFirst\fR, \fIselectLast\fR, and
96
\fIselectAnchor\fR to adjust for insertions and deletions in the
97
item (but only if the item is the current owner of the selection or
98
anchor, as determined by \fIselItemPtr\fR or \fIanchorItemPtr\fR).
99
If all of the selected text in the item is deleted, the item should
100
set \fIselItemPtr\fR to NULL to indicate that there is no longer a
101
selection.
102
 
103
.SH KEYWORDS
104
canvas, focus, insertion cursor, selection, selection anchor, text

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.