head	1.11;
access;
symbols
	core-8-5-9:1.7.2.1
	core-8-5-8:1.7
	macosx-cocoa-merge:1.9
	macosx-cocoa-premerge:1.9
	macosx-carbon-freeze:1.9
	core-8-5-7:1.7
	core-8-5-6:1.7
	core-8-6-b1:1.9
	core-8-6-a3:1.9
	core-8-5-5:1.7
	core-8-6-a2:1.8
	core-8-5-4:1.7
	core-8-5-3:1.7
	core-8-6-a1:1.7
	core-8-4-19:1.2.26.1
	core-8-5-branch:1.7.0.2
	core-8-5-2:1.7
	core-8-4-18:1.2.26.1
	core-8-5-1:1.7
	core-8-4-17:1.2.26.1
	core-8-5-0:1.7
	core-8-5-b3:1.6
	core-8-5-b2:1.5
	core-8-4-16:1.2.26.1
	core-8-5-b1:1.5
	core-stablilizer-merge:1.5
	core-stabilizer-branch:1.5.0.2
	core-stabilizer-merge:1.7
	core-8-4-15:1.2.26.1
	core-8-5-a6:1.5
	core-8-5-a5:1.5
	core-8-4-14:1.2.26.1
	core-8-5-a4:1.5
	core-8-4-13:1.2.26.1
	core-8-4-12:1.2.26.1
	core-8-4-11:1.2.26.1
	core-8-5-a3:1.5
	core-8-4-10:1.2.26.1
	core-8-4-9-branch:1.2.26.1.0.2
	core-8-5-a2:1.5
	core-8-4-9:1.2.26.1
	core-8-4-8:1.2.26.1
	core-8-4-7:1.2
	core-8-5-a1:1.2
	core-8-4-6:1.2
	core-8-4-5:1.2
	mistachkin-dev-branch:1.2.0.28
	core-8-4-4:1.2
	core-8-4-3:1.2
	core-8-4-branch:1.2.0.26
	core-8-4-2:1.2
	core-8-4-1:1.2
	core-8-3-5:1.2
	core-8-4-0:1.2
	macosx-8-4-merge-2002-08-31-trunk:1.2
	macosx-8-4-premerge-2002-08-31-branch:1.2
	macosx-8-4-premerge-2002-08-31-trunk:1.2
	macosx-8-4-merge-2002-08-30-branch:1.2
	macosx-8-4-merge-2002-08-30-trunk:1.2
	macosx-8-4-merge-2002-08-20-branch:1.2
	macosx-8-4-merge-2002-08-20-trunk:1.2
	core-8-4-b2:1.2
	core-8-4-b1:1.2
	macosx-premerge-6-9-02:1.2
	core-8-4-a4:1.2
	core-8-3-4:1.2
	macosx-8-4-branch:1.2.0.24
	macosx-8-4-branchpoint:1.2
	core-8-4-a3:1.2
	core-8-3-3:1.2
	dgp-privates-into-namespace:1.2.0.22
	tclpro-1-5-0:1.2
	core-8-4-win-speedup:1.2.0.20
	core-8-4-a2:1.2
	tclpro-1-4-1:1.2
	tclpro-1-4-0:1.2
	core-8-3-2:1.2
	ajuba-ajuba2-2-1-base:1.2
	ajuba-ajuba2-2-0:1.2
	core-8-4-a1:1.2
	core-8-3-1-branch:1.2.0.18
	core-8-3-1:1.2
	scriptics-sc-2-0-b5:1.2
	scriptics-sc-2-0-fixed:1.2
	scriptics-sc-2-0-b2:1.2
	scriptics-sc-2-0-b1:1.2
	core-8-3-0:1.2
	core-8-3-b2:1.2
	core-8-3-b1:1.2
	scriptics-sc-1-1:1.2
	scriptics-sc-1-1-b1:1.2
	core-8-2-3:1.2
	scriptics-sc-1-1-branch:1.2.0.16
	scriptics-sc-1-1-base:1.2
	scriptics-sc-1-0:1.2
	scriptics-sc-1-0-branch:1.2.0.14
	scriptics-sc-1-0-base:1.2
	core-8-2-2:1.2
	core-8-2-1:1.2
	scriptics-bc-1-0-b1:1.2
	core-8-2-1-branch:1.2.0.12
	scriptics-tclpro-1-3-0:1.2
	core-8-2-0:1.2
	core-8-2-b3-branch:1.2.0.10
	core-8-2-b3-base:1.2
	scriptics-tclpro-1-3-b4:1.2
	core-8-2-b2:1.2
	scriptics-tclpro-1-3-b3:1.2
	core-8-2-b1:1.2
	scriptics-tclpro-1-3-b2:1.2
	merge-to-mainline-5/21/99:1.2
	scriptics-tclpro-1-3-b2-branch:1.2.0.8
	core-8-1-1:1.2
	scriptics-tclpro-1-3-b1:1.2
	core-8-1-1-base:1.2
	core-8-1-0:1.2
	merge-to-mainline-4-29-99:1.2
	merge-to-mainline-4-23-99:1.2
	core-8-1-branch-old:1.1.0.4
	core-8-0-6-branch:1.2.0.6
	core-8-0-6-base:1.2
	core-8-0-5:1.2
	core-8-1-b3:1.1.4.1
	core-8-1-b2:1.1.4.1
	dev-8-1-stubs-branch:1.1.4.1.0.2
	dev-stubs-branch:1.2.0.4
	scriptics-tclpro-1-2:1.2
	scriptics-tclpro-1-2-b2:1.2
	core-8-1-merge-2/10/99:1.2
	core-8-0-5-branch:1.2.0.2
	core-8-0-5-base:1.2
	scriptics-tclpro-1-2-b1:1.2
	scriptics-tclpro-1-2-a1:1.2
	core-8-1-b1:1.1.4.1
	core-8-0-4:1.2
	core-8-1-a2:1.1
	core-8-0-2:1.1
	core-8-0-3:1.2;
locks; strict;
comment	@# @;


1.11
date	2010.01.10.20.38.54;	author dkf;	state Exp;
branches;
next	1.10;

1.10
date	2009.12.25.18.21.30;	author dkf;	state Exp;
branches;
next	1.9;

1.9
date	2008.09.23.13.36.45;	author dkf;	state Exp;
branches;
next	1.8;

1.8
date	2008.06.30.22.57.03;	author dkf;	state Exp;
branches;
next	1.7;

1.7
date	2007.12.13.15.23.43;	author dgp;	state Exp;
branches
	1.7.2.1;
next	1.6;

1.6
date	2007.10.29.16.04.13;	author dkf;	state Exp;
branches;
next	1.5;

1.5
date	2004.10.28.12.25.53;	author dkf;	state Exp;
branches
	1.5.2.1;
next	1.4;

1.4
date	2004.06.21.19.42.12;	author dkf;	state Exp;
branches;
next	1.3;

1.3
date	2004.06.18.21.50.16;	author dkf;	state Exp;
branches;
next	1.2;

1.2
date	98.09.14.18.22.58;	author stanton;	state Exp;
branches
	1.2.26.1;
next	1.1;

1.1
date	98.04.01.09.39.54;	author rjohnson;	state Exp;
branches
	1.1.4.1;
next	;

1.1.4.1
date	98.09.30.02.16.23;	author stanton;	state Exp;
branches;
next	;

1.2.26.1
date	2004.10.28.12.25.22;	author dkf;	state Exp;
branches;
next	;

1.5.2.1
date	2007.11.01.16.37.15;	author dgp;	state Exp;
branches;
next	;

1.7.2.1
date	2009.12.25.18.28.17;	author dkf;	state Exp;
branches;
next	;


desc
@@


1.11
log
@Small cleanups to improve HTML generation.
@
text
@'\"
'\" Copyright (c) 1990 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" 
'\" RCS: @@(#) $Id: option.n,v 1.10 2009/12/25 18:21:30 dkf Exp $
'\" 
.so man.macros
.TH option n "" Tk "Tk Built-In Commands"
.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
option \- Add/retrieve window options to/from the option database
.SH SYNOPSIS
.nf
\fBoption add \fIpattern value \fR?\fIpriority\fR?
\fBoption clear\fR
\fBoption get \fIwindow name class\fR
\fBoption readfile \fIfileName \fR?\fIpriority\fR?
.fi
.BE
.SH DESCRIPTION
.PP
The \fBoption\fR command allows you to add entries to the Tk option
database or to retrieve options from the database.  The \fBadd\fR
form of the command adds a new option to the database.
\fIPattern\fR contains
the option being specified, and consists of names and/or classes
separated by asterisks or dots, in the usual X format (see
\fBPATTERN FORMAT\fR).  \fIValue\fR
contains a text string to associate with \fIpattern\fR;  this is the
value that will be returned in calls to \fBTk_GetOption\fR or by
invocations of the \fBoption get\fR command.  If \fIpriority\fR
is specified, it indicates the priority level for this option (see
below for legal values);  it defaults to \fBinteractive\fR.
This command always returns an empty string.
.PP
The \fBoption clear\fR command clears the option database.  Default
options (from the
\fBRESOURCE_MANAGER\fR property or the \fB.Xdefaults\fR
file) will be reloaded automatically the next time an
option is added to the database or removed from it.  This command
always returns an empty string.
.PP
The \fBoption get\fR command returns the value of the option
specified for \fIwindow\fR
under \fIname\fR and \fIclass\fR.  If several entries in the option
database match \fIwindow\fR, \fIname\fR, and \fIclass\fR, then
the command returns whichever was created with highest
\fIpriority\fR level.  If there are several matching
entries at the same priority level, then it returns whichever entry
was most recently entered into the option database.  If there are
no matching entries, then the empty string is returned.
.PP
The \fBreadfile\fR form of the command reads \fIfileName\fR,
which should have the standard format for an
X resource database such as \fB.Xdefaults\fR, and adds all the
options specified in that file to the option database.  If \fIpriority\fR
is specified, it indicates the priority level at which to enter the
options;  \fIpriority\fR defaults to \fBinteractive\fR.
.PP
The \fIpriority\fR arguments to the \fBoption\fR command are
normally specified symbolically using one of the following values:
.TP
\fBwidgetDefault\fR
Level 20.  Used for default values hard-coded into widgets.
.TP
\fBstartupFile\fR
Level 40.  Used for options specified in application-specific
startup files.
.TP
\fBuserDefault\fR
Level 60.  Used for options specified in user-specific defaults
files, such as \fB.Xdefaults\fR, resource databases loaded into
the X server, or user-specific startup files.
.TP
\fBinteractive\fR
Level 80.  Used for options specified interactively after the application
starts running.  If \fIpriority\fR is not specified, it defaults to
this level.
.PP
Any of the above keywords may be abbreviated.  In addition, priorities
may be specified numerically using integers between 0 and 100,
inclusive.  The numeric form is probably a bad idea except for new priority
levels other than the ones given above.
.SH "PATTERN FORMAT"
.PP
Patterns consist of a sequence of words separated by either periods,
.QW . ,
or asterisks
.QW * .
The overall pattern may also be optionally preceded by an asterisk.
.PP
Each word in the pattern conventionally starts with either an upper-case
letter (in which case it denotes the class of either a widget or an option) or
any other character, when it denotes the name of a widget or option. The last
word in the pattern always indicates the option; the preceding ones constrain
which widgets that option will be looked for in.
.PP
When two words are separated by a period, the latter widget must be a direct
child of the former (or the option must apply to only the indicated widgets).
When two words are separated by an asterisk, any depth of widgets may lie
between the former and latter widgets (and the option applies to all widgets
that are children of the former widget).
.PP
If the overall pattern is preceded by an asterisk, then the overall pattern
applies anywhere it can throughout the whole widget hierarchy. Otherwise the
first word of the pattern is matched against the name and class of the
.QW \fB.\fR
\fBtoplevel\fR, which are usually set by options to \fBwish\fR.
.SH EXAMPLES
.PP
Instruct every button in the application to have red text on it unless
explicitly overridden, by setting the \fBforeground\fR for the \fBButton\fR
class (note that on some platforms the option is ignored):
.CS
\fBoption add\fR *Button.foreground red startupFile
.CE
.PP
Allow users to control what happens in an entry widget when the Return
key is pressed by specifying a script in the option database and add a
default option for that which rings the bell:
.CS
entry .e
bind .e <Return> [\fBoption get\fR .e returnCommand Command]
\fBoption add\fR *.e.returnCommand bell widgetDefault
.CE
.SH "SEE ALSO"
options(n), wish(1)
.SH KEYWORDS
database, option, priority, retrieve
'\" Local Variables:
'\" mode: nroff
'\" End:
@


1.10
log
@[Bug 2914943]: Correct the first option(n) example.
Also define what the format of option patterns is; that's a much less
commonly known fact than it used to be.
@
text
@d8 1
a8 1
'\" RCS: @@(#) $Id: option.n,v 1.9 2008/09/23 13:36:45 dkf Exp $
d31 2
a32 2
separated by asterisks or dots, in the usual X format (see \fBPATTERN
FORMAT\fR).  \fIValue\fR
@


1.9
log
@Fix [Bug 2118116]
@
text
@d8 1
a8 1
'\" RCS: @@(#) $Id: option.n,v 1.8 2008/06/30 22:57:03 dkf Exp $
d31 2
a32 1
separated by asterisks or dots, in the usual X format.  \fIValue\fR
d83 1
a83 1
.LP
d88 25
d116 2
a117 1
explicitly overridden:
d119 1
a119 1
\fBoption add\fR *button.foreground red startupFile
d130 2
@


1.8
log
@Minor doc updates (removing out of date changebars, improving typedef formatting,
 etc.)
@
text
@a0 1
'\" -*- nroff -*-
d8 1
a8 1
'\" RCS: @@(#) $Id: option.n,v 1.7 2007/12/13 15:23:43 dgp Exp $
d105 3
@


1.7
log
@merge stable branch onto HEAD
@
text
@d1 1
d9 1
a9 1
'\" RCS: @@(#) $Id: option.n,v 1.5.2.1 2007/11/01 16:37:15 dgp Exp $
a24 1

d89 1
a103 1

@


1.7.2.1
log
@[Bug 2914943]: Correct the first option(n) example.
Also define what the format of option patterns is; that's a much less
commonly known fact than it used to be.
@
text
@d8 1
a8 1
'\" RCS: @@(#) $Id: option.n,v 1.7 2007/12/13 15:23:43 dgp Exp $
d24 1
d32 1
a32 2
separated by asterisks or dots, in the usual X format (see \fBPATTERN
FORMAT\fR).  \fIValue\fR
a67 1
.
a70 1
.
a74 1
.
a79 1
.
d83 1
a83 1
.PP
a87 25
.SH "PATTERN FORMAT"
.PP
Patterns consist of a sequence of words separated by either periods,
.QW . ,
or asterisks
.QW * .
The overall pattern may also be optionally preceded by an asterisk.
.PP
Each word in the pattern conventionally starts with either an upper-case
letter (in which case it denotes the class of either a widget or an option) or
any other character, when it denotes the name of a widget or option. The last
word in the pattern always indicates the option; the preceding ones constrain
which widgets that option will be looked for in.
.PP
When two words are separated by a period, the latter widget must be a direct
child of the former (or the option must apply to only the indicated widgets).
When two words are separated by an asterisk, any depth of widgets may lie
between the former and latter widgets (and the option applies to all widgets
that are children of the former widget).
.PP
If the overall pattern is preceded by an asterisk, then the overall pattern
applies anywhere it can throughout the whole widget hierarchy. Otherwise the
first word of the pattern is matched against the name and class of the
.QW \fB.\fR
\fBtoplevel\fR, which are usually set by options to \fBwish\fR.
d90 1
a90 1
explicitly overridden (note that on some platforms the option is ignored):
d92 1
a92 1
\fBoption add\fR *Button.foreground red startupFile
d103 1
a103 2
.SH "SEE ALSO"
options(n), wish(1)
a105 3
'\" Local Variables:
'\" mode: nroff
'\" End:
@


1.6
log
@Lots more GOOBE stuff. Now works with 'make html'!
@
text
@d8 1
a8 1
'\" RCS: @@(#) $Id: option.n,v 1.5 2004/10/28 12:25:53 dkf Exp $
@


1.5
log
@More minor doc fixes
@
text
@d8 1
a8 1
'\" RCS: @@(#) $Id: option.n,v 1.4 2004/06/21 19:42:12 dkf Exp $
d81 1
a81 1
starts running.  If \fIpriority\fR isn't specified, it defaults to
@


1.5.2.1
log
@merge updates from HEAD
@
text
@d8 1
a8 1
'\" RCS: @@(#) $Id: option.n,v 1.5 2004/10/28 12:25:53 dkf Exp $
d81 1
a81 1
starts running.  If \fIpriority\fR is not specified, it defaults to
@


1.4
log
@Convert SYNOPSIS to .nf/.fi after suggestion from Joe English
@
text
@d8 1
a8 1
'\" RCS: @@(#) $Id: option.n,v 1.3 2004/06/18 21:50:16 dkf Exp $
d92 1
a92 1
\fBoption\fR add *button.foreground red startupFile
d100 2
a101 2
bind .e <Return> [\fBoption\fR get .e returnCommand Command]
\fBoption\fR add *.e.returnCommand bell widgetDefault
@


1.3
log
@Added examples
@
text
@d8 1
a8 1
'\" RCS: @@(#) $Id: option.n,v 1.2 1998/09/14 18:22:58 stanton Exp $
d17 1
a18 1
.sp
a19 1
.sp
a20 1
.sp
d22 1
@


1.2
log
@Replaced SCCS strings, fixed binary files
@
text
@d8 1
a8 1
'\" RCS: @@(#) $Id$
d89 15
@


1.2.26.1
log
@More backporting of doc fixes
@
text
@d8 1
a8 1
'\" RCS: @@(#) $Id: option.n,v 1.2 1998/09/14 18:22:58 stanton Exp $
a16 1
.nf
d18 1
d20 1
d22 1
a23 1
.fi
a88 15
.SH EXAMPLES
Instruct every button in the application to have red text on it unless
explicitly overridden:
.CS
\fBoption add\fR *button.foreground red startupFile
.CE
.PP
Allow users to control what happens in an entry widget when the Return
key is pressed by specifying a script in the option database and add a
default option for that which rings the bell:
.CS
entry .e
bind .e <Return> [\fBoption get\fR .e returnCommand Command]
\fBoption add\fR *.e.returnCommand bell widgetDefault
.CE
@


1.1
log
@Initial revision
@
text
@d8 1
a8 1
'\" SCCS: @@(#) option.n 1.10 96/03/26 18:25:08
@


1.1.4.1
log
@Merged 8.0.3 changes into 8.1
@
text
@d8 1
a8 1
'\" RCS: @@(#) $Id: option.n,v 1.2 1998/09/14 18:22:58 stanton Exp $
@


