]> www.wagner.pp.ru Git - oss/ck.git/blob - doc/bindtags.n
Ck console graphics toolkit
[oss/ck.git] / doc / bindtags.n
1 '\"
2 '\" Copyright (c) 1990 The Regents of the University of California.
3 '\" Copyright (c) 1994-1995 Sun Microsystems, Inc.
4 '\" Copyright (c) 1996-1999 Christian Werner
5 '\"
6 '\" See the file "license.terms" for information on usage and redistribution
7 '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
8 '\" 
9 .so man.macros
10 .TH bindtags n 8.0 Ck "Ck Built-In Commands"
11 .BS
12 '\" Note:  do not modify the .SH NAME line immediately below!
13 .SH NAME
14 bindtags \- Determine which bindings apply to a window, and order of evaluation
15 .SH SYNOPSIS
16 \fBbindtags \fIwindow \fR?\fItagList\fR?
17 .BE
18
19 .SH DESCRIPTION
20 .PP
21 When a binding is created with the \fBbind\fR command, it is
22 associated either with a particular window such as \fB.a.b.c\fR,
23 a class name such as \fBButton\fR, the keyword \fBall\fR, or any
24 other string.
25 All of these forms are called \fIbinding tags\fR.
26 Each window contains a list of binding tags that determine how
27 events are processed for the window.
28 When an event occurs in a window, it is applied to each of the
29 window's tags in order:  for each tag, the most specific binding
30 that matches the given tag and event is executed.
31 See the \fBbind\fR command for more information on the matching
32 process.
33 .PP
34 By default, each window has four binding tags consisting of the
35 name of the window, the window's class name, the name of the window's
36 nearest toplevel ancestor, and \fBall\fR, in that order.
37 Toplevel windows have only three tags by default, since the toplevel
38 name is the same as that of the window.
39 The \fBbindtags\fR command allows the binding tags for a window to be
40 read and modified.
41 .PP
42 If \fBbindtags\fR is invoked with only one argument, then the
43 current set of binding tags for \fIwindow\fR is returned as a list.
44 If the \fItagList\fR argument is specified to \fBbindtags\fR,
45 then it must be a proper list; the tags for \fIwindow\fR are changed
46 to the elements of the list.
47 The elements of \fItagList\fR may be arbitrary strings;  however,
48 any tag starting with a dot is treated as the name of a window;  if
49 no window by that name exists at the time an event is processed,
50 then the tag is ignored for that event.
51 The order of the elements in \fItagList\fR determines the order in
52 which binding scripts are executed in response to events.
53 For example, the command
54 .DS
55 \fBbindtags .b {all . Button .b}\fR
56 .DE
57 reverses the order in which binding scripts will be evaluated for
58 a button named \fB.b\fR so that \fBall\fR bindings are invoked
59 first, following by bindings for \fB.b\fR's toplevel (``.''), followed by
60 class bindings, followed by bindings for \fB.b\fR.
61 .PP
62 The \fBbindtags\fR command may be used to introduce arbitrary
63 additional binding tags for a window, or to remove standard tags.
64 For example, the command
65 .DS
66 \fBbindtags .b {.b TrickyButton . all}\fR
67 .DE
68 replaces the \fBButton\fR tag for \fB.b\fR with \fBTrickyButton\fR.
69 This means that the default widget bindings for buttons, which are
70 associated with the \fBButton\fR tag, will no longer apply to \fB.b\fR,
71 but any bindings associated with \fBTrickyButton\fR (perhaps some
72 new button behavior) will apply.
73
74 .SH "SEE ALSO"
75 bind
76
77 .SH KEYWORDS
78 binding, event, tag