projman/hlp/en/tk/option.htm
2015-10-19 14:27:31 +04:00

97 lines
4.7 KiB
HTML

<HTML><HEAD><TITLE>Built-In Commands - option manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="option.htm#M2" NAME="L823">NAME</A>
<DL><DD>option - Add/retrieve window options to/from the option database</DL>
<DD><A HREF="option.htm#M3" NAME="L824">SYNOPSIS</A>
<DL>
<DD><B>option add </B><I>pattern value </I>?<I>priority</I>?
<DD><B>option clear</B>
<DD><B>option get </B><I>window name class</I>
<DD><B>option readfile </B><I>fileName </I>?<I>priority</I>?
</DL>
<DD><A HREF="option.htm#M4" NAME="L825">DESCRIPTION</A>
<DL>
<DD><A HREF="option.htm#M5" NAME="L826"><B>widgetDefault</B></A>
<DD><A HREF="option.htm#M6" NAME="L827"><B>startupFile</B></A>
<DD><A HREF="option.htm#M7" NAME="L828"><B>userDefault</B></A>
<DD><A HREF="option.htm#M8" NAME="L829"><B>interactive</B></A>
</DL>
<DD><A HREF="option.htm#M9" NAME="L830">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
option - Add/retrieve window options to/from the option database
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>option add </B><I>pattern value </I>?<I>priority</I>?<BR>
<B>option clear</B><BR>
<B>option get </B><I>window name class</I><BR>
<B>option readfile </B><I>fileName </I>?<I>priority</I>?<BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
The <B>option</B> command allows you to add entries to the Tk option
database or to retrieve options from the database. The <B>add</B>
form of the command adds a new option to the database.
<I>Pattern</I> contains
the option being specified, and consists of names and/or classes
separated by asterisks or dots, in the usual X format. <I>Value</I>
contains a text string to associate with <I>pattern</I>; this is the
value that will be returned in calls to <B><A HREF="../TclLib/GetOption.htm">Tk_GetOption</A></B> or by
invocations of the <B>option get</B> command. If <I>priority</I>
is specified, it indicates the priority level for this option (see
below for legal values); it defaults to <B>interactive</B>.
This command always returns an empty string.
<P>
The <B>option clear</B> command clears the option database. Default
options (from the
<B>RESOURCE_MANAGER</B> property or the <B>.Xdefaults</B>
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.
<P>
The <B>option get</B> command returns the value of the option
specified for <I>window</I>
under <I>name</I> and <I>class</I>. If several entries in the option
database match <I>window</I>, <I>name</I>, and <I>class</I>, then
the command returns whichever was created with highest
<I>priority</I> 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.
<P>
The <B>readfile</B> form of the command reads <I>fileName</I>,
which should have the standard format for an
X resource database such as <B>.Xdefaults</B>, and adds all the
options specified in that file to the option database. If <I>priority</I>
is specified, it indicates the priority level at which to enter the
options; <I>priority</I> defaults to <B>interactive</B>.
<P>
The <I>priority</I> arguments to the <B>option</B> command are
normally specified symbolically using one of the following values:
<P>
<DL>
<P><DT><A NAME="M5"><B>widgetDefault</B></A><DD>
Level 20. Used for default values hard-coded into widgets.
<P><DT><A NAME="M6"><B>startupFile</B></A><DD>
Level 40. Used for options specified in application-specific
startup files.
<P><DT><A NAME="M7"><B>userDefault</B></A><DD>
Level 60. Used for options specified in user-specific defaults
files, such as <B>.Xdefaults</B>, resource databases loaded into
the X server, or user-specific startup files.
<P><DT><A NAME="M8"><B>interactive</B></A><DD>
Level 80. Used for options specified interactively after the application
starts running. If <I>priority</I> isn't specified, it defaults to
this level.
<P></DL>
<P>
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.
<H3><A NAME="M9">KEYWORDS</A></H3>
<A href="../Keywords/D.htm#database">database</A>, <A href="../Keywords/O.htm#option">option</A>, <A href="../Keywords/P.htm#priority">priority</A>, <A href="../Keywords/R.htm#retrieve">retrieve</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1990 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>