source: project/release/4/tk/doc/html/Commands/Tk/createwidget/Text/Command/tag/tag_bind.htm @ 15195

Last change on this file since 15195 was 15195, checked in by felix winkelmann, 11 years ago

imported tk for chicken 4

File size: 18.2 KB
Line 
1<?xml version="1.0"?>
2<html>
3<head>
4
5    <link rel="last" href="tag_remove.htm" title="tag remove" />
6    <link rel="first" href="tag_add.htm" title="tag add" />
7    <link rel="section" href="../../../../../bitmap.htm" title="bitmap" />
8    <link rel="section" href="../../../../../evalwish.htm" title="eval-wish" />
9    <link rel="section" href="../../../../../gettkvar.htm" title="get-tk-var" />
10    <link rel="section" href="../../../../../photo.htm" title="photo" />
11    <link rel="section" href="../../../../../settkvar.htm" title="set-tk-var!" />
12    <link rel="section" href="../../../../../tk.htm" title="tk" />
13    <link rel="section" href="../../../../../tkidwidget.htm" title="tk-id-&gt;widget" />
14    <link rel="section" href="../../../../../tkvar.htm" title="tk-var" />
15    <link rel="section" href="../../../../../tkafter.htm" title="tk/after" />
16    <link rel="section" href="../../../../../tkappname.htm" title="tk/appname" />
17    <link rel="section" href="../../../../../tkbind.htm" title="tk/bind" />
18    <link rel="section" href="../../../../../tkbindtags.htm" title="tk/bindtags" />
19    <link rel="section" href="../../../../../tkcaret.htm" title="tk/caret" />
20    <link rel="section" href="../../../../../tkchoosecolor.htm" title="tk/choosecolor" />
21    <link rel="section" href="../../../../../tkchoosedirectory.htm" title="tk/choosedirectory" />
22    <link rel="section" href="../../../../../tkclipboard.htm" title="tk/clipboard" />
23    <link rel="section" href="../../../../../tkconsole.htm" title="tk/console" />
24    <link rel="section" href="../../../../../tkdestroy.htm" title="tk/destroy" />
25    <link rel="section" href="../../../../../tkdialog.htm" title="tk/dialog" />
26    <link rel="section" href="../../../../../tkevent.htm" title="tk/event" />
27    <link rel="section" href="../../../../../tkfocus.htm" title="tk/focus" />
28    <link rel="section" href="../../../../../tkgetopenfile.htm" title="tk/getopenfile" />
29    <link rel="section" href="../../../../../tkgetsavefile.htm" title="tk/getsavefile" />
30    <link rel="section" href="../../../../../tkgrab.htm" title="tk/grab" />
31    <link rel="section" href="../../../../../tkgrid.htm" title="tk/grid" />
32    <link rel="section" href="../../../../../tkimage.htm" title="tk/image" />
33    <link rel="section" href="../../../../../tklower.htm" title="tk/lower" />
34    <link rel="section" href="../../../../../tkmessagebox.htm" title="tk/messagebox" />
35    <link rel="section" href="../../../../../tkoption.htm" title="tk/option" />
36    <link rel="section" href="../../../../../tkpack.htm" title="tk/pack" />
37    <link rel="section" href="../../../../../tkplace.htm" title="tk/place" />
38    <link rel="section" href="../../../../../tkpopup.htm" title="tk/popup" />
39    <link rel="section" href="../../../../../tkraise.htm" title="tk/raise" />
40    <link rel="section" href="../../../../../tkscaling.htm" title="tk/scaling" />
41    <link rel="section" href="../../../../../tkupdate.htm" title="tk/update" />
42    <link rel="section" href="../../../../../tkuseinputmethods.htm" title="tk/useinputmethods" />
43    <link rel="section" href="../../../../../tkwait.htm" title="tk/wait" />
44    <link rel="section" href="../../../../../tkwindowingsystem.htm" title="tk/windowingsystem" />
45    <link rel="section" href="../../../../../tkwinfo.htm" title="tk/winfo" />
46    <link rel="section" href="../../../../../tkwm.htm" title="tk/wm" />
47    <link rel="up" href="../tag.htm" title="tag" />
48    <link rel="prev" href="tag_add.htm" title="tag add" />
49    <link rel="contents" href="../../../../../../Meta/Sitemap.htm" title="Sitemap" />
50    <link rel="start" href="../../../../../../../index.htm" title="Chicken/Tk" />
51    <link rel="author" href="../../../../../../Meta/Author.htm" title="Author" />
52    <link rel="subsection" href="../../../../index.htm" title="create-widget" />
53    <link rel="subsection" href="../../../../getid.htm" title="get-id" />
54    <link rel="subsection" href="../../../../exec.htm" title="exec" />
55    <link rel="subsection" href="../../../../call.htm" title="call" />
56    <link rel="chapter" href="../../../../../../Preface.htm" title="Preface" />
57    <link rel="chapter" href="../../../../../../Introduction.htm" title="Introduction" />
58    <link rel="chapter" href="../../../../../../Tutorial.htm" title="Tutorial" />
59    <link rel="chapter" href="../../../../../../Implementation.htm" title="Implementation" />
60    <link rel="chapter" href="../../../../../../Commands.htm" title="Commands" />
61    <link rel="chapter" href="../../../../../../Options.htm" title="Options" />
62    <link rel="chapter" href="../../../../../../Extensions.htm" title="Extensions" />
63    <link rel="chapter" href="../../../../../../List_of_Changes.htm" title="List of Changes" />
64    <link rel="next" href="tag_cget.htm" title="tag cget" /> 
65<title>
66tag bind</title>
67 
68<link rel="stylesheet" href="../../../../../../res/css/examples/navigationtree/BlueGray/layout.css" />
69 
70<link rel="stylesheet" href="../../../../../../res/css/examples/navigationtree/BlueGray/color.css" />
71
72<style type="text/css">
73dt {
74        color: #000080;
75        font-family: monospace;
76       
77}
78</style>
79</head>
80 
81<body style="padding: 0; margin: 0"><table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
82<tr>
83<td colspan="2" class="navicolumn">&#160;</td>
84 
85<td></td>
86 
87<td></td>
88 
89<td></td>
90</tr>
91 
92<tr>
93<td rowspan="2" class="navicolumn"><img src="../../../../../../res/css/examples/navigationtree/BlueGray/bg_00.gif" height="1" width="20" /></td>
94 
95<td rowspan="2" align="right" class="navicolumn"><img src="../../../../../../res/css/examples/navigationtree/BlueGray/Titelhintergrund_l.gif" /></td>
96 
97<td rowspan="2" id="title" width="60%" nowrap="nowrap">
98<h1>tag bind</h1>
99</td>
100 
101<td style="vertical-align: top; background-image: url(../../../../../../res/css/examples/navigationtree/BlueGray/SchattenOst.gif); background-repeat: repeat-y; "><img src="../../../../../../res/css/examples/navigationtree/BlueGray/SchattenNordOst.gif" width="7" height="7" /></td>
102 
103<td><img src="../../../../../../res/css/examples/navigationtree/BlueGray/bg_02_05.gif" width="41" height="7" /></td>
104</tr>
105 
106<tr>
107<td style="background-image: url(../../../../../../res/css/examples/navigationtree/BlueGray/SchattenOst.gif)"><img src="../../../../../../res/css/examples/navigationtree/BlueGray/SchattenOst.gif" /></td>
108 
109<td></td>
110</tr>
111 
112<tr>
113<td class="navicolumn"><img src="../../../../../../res/css/examples/navigationtree/BlueGray/bg_00.gif" /></td>
114 
115<td class="navicolumn" align="right"><img src="../../../../../../res/css/examples/navigationtree/BlueGray/SchattenNavi.gif" width="136" height="8" /></td>
116 
117<td style="background-image: url(../../../../../../res/css/examples/navigationtree/BlueGray/SchattenSued.gif); background-repeat: repeat-x"><img src="../../../../../../res/css/examples/navigationtree/BlueGray/SchattenSued.gif" width="100%" height="8" /></td>
118 
119<td><img src="../../../../../../res/css/examples/navigationtree/BlueGray/SchattenSuedOst.gif" width="7" height="8" /></td>
120 
121<td width="80%"><img src="../../../../../../res/css/examples/navigationtree/BlueGray/bg_04_05.gif" width="41" height="8" /></td>
122</tr>
123 
124<tr>
125<td class="navicolumn">&#160;</td>
126 
127<td height="100%" nowrap="nowrap" class="navicolumn" id="navi">
128
129<ul>
130<li><a href="../../../../../../Preface.htm" target="_top">Preface</a></li>
131<li><a href="../../../../../../Introduction.htm" target="_top">Introduction</a></li>
132<li><a href="../../../../../../Tutorial.htm" target="_top">Tutorial</a></li>
133<li><a href="../../../../../../Implementation.htm" target="_top">Implementation</a></li>
134<li><a href="../../../../../../Commands.htm" target="_top">Commands</a>
135<ul>
136<li><a href="../../../../../bitmap.htm" target="_top">bitmap</a></li>
137<li><a href="../../../../../evalwish.htm" target="_top">eval-wish</a></li>
138<li><a href="../../../../../gettkvar.htm" target="_top">get-tk-var</a></li>
139<li><a href="../../../../../photo.htm" target="_top">photo</a></li>
140<li><a href="../../../../../settkvar.htm" target="_top">set-tk-var!</a></li>
141<li><a href="../../../../../tk.htm" target="_top">tk</a>
142<ul>
143<li><a href="../../../../index.htm" target="_top">create-widget</a>
144<ul>
145<li><a href="../../../button.htm" target="_top">button</a></li>
146<li><a href="../../../canvas.htm" target="_top">canvas</a></li>
147<li><a href="../../../checkbutton.htm" target="_top">checkbutton</a></li>
148<li><a href="../../../entry.htm" target="_top">entry</a></li>
149<li><a href="../../../frame.htm" target="_top">frame</a></li>
150<li><a href="../../../label.htm" target="_top">label</a></li>
151<li><a href="../../../labelframe.htm" target="_top">labelframe</a></li>
152<li><a href="../../../listbox.htm" target="_top">listbox</a></li>
153<li><a href="../../../menu.htm" target="_top">menu</a></li>
154<li><a href="../../../menubutton.htm" target="_top">menubutton</a></li>
155<li><a href="../../../message.htm" target="_top">message</a></li>
156<li><a href="../../../panedwindow.htm" target="_top">panedwindow</a></li>
157<li><a href="../../../radiobutton.htm" target="_top">radiobutton</a></li>
158<li><a href="../../../scale.htm" target="_top">scale</a></li>
159<li><a href="../../../scrollbar.htm" target="_top">scrollbar</a></li>
160<li><a href="../../../scrolledtext.htm" target="_top">scrolledtext</a></li>
161<li><a href="../../../spinbox.htm" target="_top">spinbox</a></li>
162<li><a href="../../../text.htm" target="_top">text</a>
163<ul>
164<li><a href="../../Indices.htm" target="_top">Indices</a></li>
165<li><a href="../../Tags.htm" target="_top">Tags</a></li>
166<li><a href="../../Marks.htm" target="_top">Marks</a></li>
167<li><a href="../../Embedded_Windows.htm" target="_top">Embedded Windows</a></li>
168<li><a href="../../Embedded_Images.htm" target="_top">Embedded Images</a></li>
169<li><a href="../../Selection.htm" target="_top">Selection</a></li>
170<li><a href="../../Insertion_Cursor.htm" target="_top">Insertion Cursor</a></li>
171<li><a href="../../Modified_Flag.htm" target="_top">Modified Flag</a></li>
172<li><a href="../../The_Undo_Mechanism.htm" target="_top">The Undo Mechanism</a></li>
173<li><a href="../../Bindings.htm" target="_top">Bindings</a></li>
174<li><a href="../../Performance_Issues.htm" target="_top">Performance</a></li>
175<li><a href="../../Command.htm" target="_top">Command</a>
176<ul>
177<li><a href="../bbox.htm" target="_top">bbox</a></li>
178<li><a href="../cget.htm" target="_top">cget</a></li>
179<li><a href="../compare.htm" target="_top">compare</a></li>
180<li><a href="../configure.htm" target="_top">configure</a></li>
181<li><a href="../createwidget.htm" target="_top">create-widget</a></li>
182<li><a href="../delete.htm" target="_top">delete</a></li>
183<li><a href="../dlineinfo.htm" target="_top">dlineinfo</a></li>
184<li><a href="../dump.htm" target="_top">dump</a></li>
185<li><a href="../edit.htm" target="_top">edit</a></li>
186<li><a href="../get.htm" target="_top">get</a></li>
187<li><a href="../image.htm" target="_top">image</a></li>
188<li><a href="../index.htm" target="_top">index</a></li>
189<li><a href="../insert.htm" target="_top">insert</a></li>
190<li><a href="../mark.htm" target="_top">mark</a></li>
191<li><a href="../scan.htm" target="_top">scan</a></li>
192<li><a href="../search.htm" target="_top">search</a></li>
193<li><a href="../see.htm" target="_top">see</a></li>
194<li><a href="../tag.htm" target="_top">tag</a>
195<ul>
196<li><a href="tag_add.htm" target="_top">add</a></li>
197<li id="actualdocument"><a>bind</a></li>
198<li><a href="tag_cget.htm" target="_top">cget</a></li>
199<li><a href="tag_configure.htm" target="_top">configure</a></li>
200<li><a href="tag_delete.htm" target="_top">delete</a></li>
201<li><a href="tag_lower.htm" target="_top">lower</a></li>
202<li><a href="tag_names.htm" target="_top">names</a></li>
203<li><a href="tag_nextrange.htm" target="_top">nextrange</a></li>
204<li><a href="tag_prevrange.htm" target="_top">prevrange</a></li>
205<li><a href="tag_raise.htm" target="_top">raise</a></li>
206<li><a href="tag_ranges.htm" target="_top">ranges</a></li>
207<li><a href="tag_remove.htm" target="_top">remove</a></li>
208</ul></li>
209<li><a href="../window.htm" target="_top">window</a></li>
210<li><a href="../xview.htm" target="_top">xview</a></li>
211<li><a href="../yview.htm" target="_top">yview</a></li>
212</ul></li>
213<li><a href="../../Options.htm" target="_top">Options</a></li>
214</ul></li>
215<li><a href="../../../tk_optionMenu.htm" target="_top">tk_optionMenu</a></li>
216<li><a href="../../../toplevel.htm" target="_top">toplevel</a></li>
217</ul></li>
218<li><a href="../../../../getid.htm" target="_top">get-id</a></li>
219<li><a href="../../../../exec.htm" target="_top">exec</a></li>
220<li><a href="../../../../call.htm" target="_top">call</a></li>
221</ul></li>
222<li><a href="../../../../../tkidwidget.htm" target="_top">tk-id-&gt;widget</a></li>
223<li><a href="../../../../../tkvar.htm" target="_top">tk-var</a></li>
224<li><a href="../../../../../tkafter.htm" target="_top">tk/after</a></li>
225<li><a href="../../../../../tkappname.htm" target="_top">tk/appname</a></li>
226<li><a href="../../../../../tkbind.htm" target="_top">tk/bind</a></li>
227<li><a href="../../../../../tkbindtags.htm" target="_top">tk/bindtags</a></li>
228<li><a href="../../../../../tkcaret.htm" target="_top">tk/caret</a></li>
229<li><a href="../../../../../tkchoosecolor.htm" target="_top">tk/choosecolor</a></li>
230<li><a href="../../../../../tkchoosedirectory.htm" target="_top">tk/choosedirectory</a></li>
231<li><a href="../../../../../tkclipboard.htm" target="_top">tk/clipboard</a></li>
232<li><a href="../../../../../tkconsole.htm" target="_top">tk/console</a></li>
233<li><a href="../../../../../tkdestroy.htm" target="_top">tk/destroy</a></li>
234<li><a href="../../../../../tkdialog.htm" target="_top">tk/dialog</a></li>
235<li><a href="../../../../../tkevent.htm" target="_top">tk/event</a></li>
236<li><a href="../../../../../tkfocus.htm" target="_top">tk/focus</a></li>
237<li><a href="../../../../../tkgetopenfile.htm" target="_top">tk/getopenfile</a></li>
238<li><a href="../../../../../tkgetsavefile.htm" target="_top">tk/getsavefile</a></li>
239<li><a href="../../../../../tkgrab.htm" target="_top">tk/grab</a></li>
240<li><a href="../../../../../tkgrid.htm" target="_top">tk/grid</a></li>
241<li><a href="../../../../../tkimage.htm" target="_top">tk/image</a></li>
242<li><a href="../../../../../tklower.htm" target="_top">tk/lower</a></li>
243<li><a href="../../../../../tkmessagebox.htm" target="_top">tk/messagebox</a></li>
244<li><a href="../../../../../tkoption.htm" target="_top">tk/option</a></li>
245<li><a href="../../../../../tkpack.htm" target="_top">tk/pack</a></li>
246<li><a href="../../../../../tkplace.htm" target="_top">tk/place</a></li>
247<li><a href="../../../../../tkpopup.htm" target="_top">tk/popup</a></li>
248<li><a href="../../../../../tkraise.htm" target="_top">tk/raise</a></li>
249<li><a href="../../../../../tkscaling.htm" target="_top">tk/scaling</a></li>
250<li><a href="../../../../../tkupdate.htm" target="_top">tk/update</a></li>
251<li><a href="../../../../../tkuseinputmethods.htm" target="_top">tk/useinputmethods</a></li>
252<li><a href="../../../../../tkwait.htm" target="_top">tk/wait</a></li>
253<li><a href="../../../../../tkwindowingsystem.htm" target="_top">tk/windowingsystem</a></li>
254<li><a href="../../../../../tkwinfo.htm" target="_top">tk/winfo</a></li>
255<li><a href="../../../../../tkwm.htm" target="_top">tk/wm</a></li>
256</ul></li>
257<li><a href="../../../../../../Options.htm" target="_top">Options</a></li>
258<li><a href="../../../../../../Extensions.htm" target="_top">Extensions</a></li>
259<li><a href="../../../../../../List_of_Changes.htm" target="_top">Changes</a></li>
260</ul></td>
261 
262<td colspan="3" style="vertical-align: top; padding-top: 1em; padding-left: 16px" id="content">
263
264
265    <dl>
266      <dt>(#&lt;widget> 'tag 'bind tagName ?sequence? ?script?)</dt>
267   
268      <dd>This command associates script with the tag given by tagName. Whenever the event sequence given by sequence occurs for a character that has been tagged with tagName, the script will be invoked. This widget command is similar to the bind command except that it operates on characters in a text rather than entire widgets. See the bind manual entry for complete details on the syntax of sequence and the substitutions performed on script before invoking it. If all arguments are specified then a new binding is created, replacing any existing binding for the same sequence and tagName (if the first character of script is ``+'' then script augments an existing binding rather than replacing it). In this case the return value is an empty string. If script is omitted then the command returns the script associated with tagName and sequence (an error occurs if there is no such binding). If both script and sequence are omitted then the command returns a list of all the sequences for which bindings have been defined for tagName.
269        <p>The only events for which bindings may be specified are those related to the mouse and keyboard (such as Enter, Leave, ButtonPress, Motion, and KeyPress) or virtual events. Event bindings for a text widget use the current mark described under MARKS above. An Enter event triggers for a tag when the tag first becomes present on the current character, and a Leave event triggers for a tag when it ceases to be present on the current character. Enter and Leave events can happen either because the current mark moved or because the character at that position changed. Note that these events are different than Enter and Leave events for windows. Mouse and keyboard events are directed to the current character. If a virtual event is used in a binding, that binding can trigger only if the virtual event is defined by an underlying mouse-related or keyboard-related event.</p>
270     
271        <p>It is possible for the current character to have multiple tags, and for each of them to have a binding for a particular event sequence. When this occurs, one binding is invoked for each tag, in order from lowest-priority to highest priority. If there are multiple matching bindings for a single tag, then the most specific binding is chosen (see the manual entry for the bind command for details). continue and break commands within binding scripts are processed in the same way as for bindings created with the bind command.</p>
272     
273        <p>If bindings are created for the widget as a whole using the bind command, then those bindings will supplement the tag bindings. The tag bindings will be invoked first, followed by bindings for the window as a whole.</p>
274      </dd>
275    </dl>
276 
277
278<hr />
279
280<p>
281&copy; <a href="../../../../../../Meta/Author.htm" target="_top">Author</a> 
282 | <a href="../../../../../../../index.htm" target="_top">Home</a> 
283 | <a href="../../../../../../Meta/Sitemap.htm" target="_top">Sitemap</a> 
284</p>
285</td>
286</tr>
287</table>
288
289</body>
290</html>
Note: See TracBrowser for help on using the repository browser.