option (n)
Add/retrieve window options to/from the option database
SYNOPSIS
option add pattern value ?priority?
option clear
option get window name class
option readfile fileName ?priority?
DESCRIPTION
The option command allows you to add entries to the Tk option
database or to retrieve options from the database. The add
form of the command adds a new option to the database.
Pattern contains
the option being specified, and consists of names and/or classes
separated by asterisks or dots, in the usual X format. Value
contains a text string to associate with pattern; this is the
value that will be returned in calls to Tk_GetOption or by
invocations of the option get command. If priority
is specified, it indicates the priority level for this option (see
below for legal values); it defaults to interactive.
This command always returns an empty string.
The option clear command clears the option database. Default
options (from the
RESOURCE_MANAGER property or the .Xdefaults
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.
The option get command returns the value of the option
specified for window
under name and class. If several entries in the option
database match window, name, and class, then
the command returns whichever was created with highest
priority 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.
The readfile form of the command reads fileName,
which should have the standard format for an
X resource database such as .Xdefaults, and adds all the
options specified in that file to the option database. If priority
is specified, it indicates the priority level at which to enter the
options; priority defaults to interactive.
The priority arguments to the option command are
normally specified symbolically using one of the following values:
widgetDefault
Level 20. Used for default values hard-coded into widgets.
startupFile
Level 40. Used for options specified in application-specific
startup files.
userDefault
Level 60. Used for options specified in user-specific defaults
files, such as .Xdefaults, resource databases loaded into
the X server, or user-specific startup files.
interactive
Level 80. Used for options specified interactively after the application
starts running. If priority isn't specified, it defaults to
this level.
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.
KEYWORDS
database, option, priority, retrieve
'\"
'\" Copyright (c) 1990-1994 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: optionMenu.n,v 1.2 1998/09/14 18:22:58 stanton Exp $
'\"
'\" The definitions below are for supplemental macros used in Tcl/Tk
'\" manual entries.
'\"
'\" .AP type name in/out ?indent?
'\" Start paragraph describing an argument to a library procedure.
'\" type is type of argument (int, etc.), in/out is either "in", "out",
'\" or "in/out" to describe whether procedure reads or modifies arg,
'\" and indent is equivalent to second arg of .IP (shouldn't ever be
'\" needed; use .AS below instead)
'\"
'\" .AS ?type? ?name?
'\" Give maximum sizes of arguments for setting tab stops. Type and
'\" name are examples of largest possible arguments that will be passed
'\" to .AP later. If args are omitted, default tab stops are used.
'\"
'\" .BS
'\" Start box enclosure. From here until next .BE, everything will be
'\" enclosed in one large box.
'\"
'\" .BE
'\" End of box enclosure.
'\"
'\" .CS
'\" Begin code excerpt.
'\"
'\" .CE
'\" End code excerpt.
'\"
'\" .VS ?version? ?br?
'\" Begin vertical sidebar, for use in marking newly-changed parts
'\" of man pages. The first argument is ignored and used for recording
'\" the version when the .VS was added, so that the sidebars can be
'\" found and removed when they reach a certain age. If another argument
'\" is present, then a line break is forced before starting the sidebar.
'\"
'\" .VE
'\" End of vertical sidebar.
'\"
'\" .DS
'\" Begin an indented unfilled display.
'\"
'\" .DE
'\" End of indented unfilled display.
'\"
'\" .SO
'\" Start of list of standard options for a Tk widget. The
'\" options follow on successive lines, in four columns separated
'\" by tabs.
'\"
'\" .SE
'\" End of list of standard options for a Tk widget.
'\"
'\" .OP cmdName dbName dbClass
'\" Start of description of a specific option. cmdName gives the
'\" option's name as specified in the class command, dbName gives
'\" the option's name in the option database, and dbClass gives
'\" the option's class in the option database.
'\"
'\" .UL arg1 arg2
'\" Print arg1 underlined, then print arg2 normally.
'\"
'\" RCS: @(#) $Id: man.macros,v 1.2 1998/09/14 18:39:54 stanton Exp $
'\"
'\" # Set up traps and other miscellaneous stuff for Tcl/Tk man pages.
t .wh -1.3i ^B
^l \n(.l
b
'\" # Start an argument description
AP
!"\\$4"" .TP \\$4
\{\
!"\\$2"" .TP \\n()Cu
.TP 15
|
|