1 |
578 |
markom |
'\"
|
2 |
|
|
'\" Copyright (c) 1993-1998 Lucent Technologies, 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: usual.n,v 1.1.1.1 2002-01-16 10:24:47 markom Exp $
|
8 |
|
|
'\"
|
9 |
|
|
.so man.macros
|
10 |
|
|
.TH usual n 3.0 itk "[incr\ Tk]"
|
11 |
|
|
.BS
|
12 |
|
|
'\" Note: do not modify the .SH NAME line immediately below!
|
13 |
|
|
.SH NAME
|
14 |
|
|
usual \- access default option-handling commands
|
15 |
|
|
.br
|
16 |
|
|
for a mega-widget component
|
17 |
|
|
.SH SYNOPSIS
|
18 |
|
|
\fBusual ?\fItag\fR? ?\fIcommands\fR?
|
19 |
|
|
.BE
|
20 |
|
|
|
21 |
|
|
.SH DESCRIPTION
|
22 |
|
|
.PP
|
23 |
|
|
The \fBusual\fR command is used outside of an \fB[incr\ Tcl]\fR
|
24 |
|
|
class definition to define the usual set of option-handling
|
25 |
|
|
commands for a component widget. Option-handling commands
|
26 |
|
|
are used when a component is registered with the \fBArchetype\fR
|
27 |
|
|
base class via the "\fBitk_component add\fR" method. They
|
28 |
|
|
specify how the component's configuration options should be
|
29 |
|
|
integrated into the composite option list for the mega-widget.
|
30 |
|
|
Options can be kept, renamed, or ignored, as described in the
|
31 |
|
|
\fBArchetype\fR man page.
|
32 |
|
|
.PP
|
33 |
|
|
It is tedious to include the same declarations again and again
|
34 |
|
|
whenever components are added. The \fBusual\fR command allows
|
35 |
|
|
a standard code fragment to be registered for each widget class,
|
36 |
|
|
which is used by default to handle the options. All of the
|
37 |
|
|
standard Tk widgets have \fBusual\fR declarations defined in
|
38 |
|
|
the \fB[incr\ Tk]\fR library. Similar \fBusual\fR declarations
|
39 |
|
|
should be created whenever a new mega-widget class is conceived.
|
40 |
|
|
Only the most-generic options should be included in the \fBusual\fR
|
41 |
|
|
declaration.
|
42 |
|
|
.PP
|
43 |
|
|
The \fItag\fR name is usually the name of a widget class,
|
44 |
|
|
which starts with a capital letter; however, any string registered
|
45 |
|
|
here can be used later with the \fBusual\fR command described
|
46 |
|
|
on the \fBArchetype\fR man page.
|
47 |
|
|
.PP
|
48 |
|
|
If the \fIcommands\fR argument is specified, it is associated
|
49 |
|
|
with the \fItag\fR string, and can be accessed later via
|
50 |
|
|
\fBitk_component add\fR.
|
51 |
|
|
.PP
|
52 |
|
|
If only the \fItag\fR argument is specified, this command looks for
|
53 |
|
|
an existing \fItag\fR name and returns the commands associated
|
54 |
|
|
with it. If there are no commands associated with \fItag\fR,
|
55 |
|
|
this command returns the null string.
|
56 |
|
|
.PP
|
57 |
|
|
If no arguments are specified, this command returns a list of
|
58 |
|
|
all \fItag\fR names previously registered.
|
59 |
|
|
|
60 |
|
|
.SH EXAMPLE
|
61 |
|
|
Following is the \fBusual\fR declaration for the standard
|
62 |
|
|
Tk button widget:
|
63 |
|
|
.CS
|
64 |
|
|
usual Button {
|
65 |
|
|
keep -background -cursor -foreground -font
|
66 |
|
|
keep -activebackground -activeforeground -disabledforeground
|
67 |
|
|
keep -highlightcolor -highlightthickness
|
68 |
|
|
rename -highlightbackground -background background Background
|
69 |
|
|
}
|
70 |
|
|
.CE
|
71 |
|
|
Only the options that would be common to all buttons in a
|
72 |
|
|
single mega-widget are kept or renamed. Options like "-text"
|
73 |
|
|
that would be unique to a particular button are ignored.
|
74 |
|
|
|
75 |
|
|
.SH KEYWORDS
|
76 |
|
|
itk, Archetype, component, mega-widget
|