home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / tcl / tk3.3b1 / doc / option.n < prev    next >
Encoding:
Text File  |  1993-04-01  |  4.3 KB  |  105 lines

  1. '\"
  2. '\" Copyright (c) 1990 The Regents of the University of California.
  3. '\" All rights reserved.
  4. '\"
  5. '\" Permission is hereby granted, without written agreement and without
  6. '\" license or royalty fees, to use, copy, modify, and distribute this
  7. '\" documentation for any purpose, provided that the above copyright
  8. '\" notice and the following two paragraphs appear in all copies.
  9. '\"
  10. '\" IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
  11. '\" FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
  12. '\" ARISING OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
  13. '\" CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14. '\"
  15. '\" THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
  16. '\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  17. '\" AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
  18. '\" ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  19. '\" PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  20. '\" 
  21. '\" $Header: /user6/ouster/wish/man/RCS/option.n,v 1.5 93/04/01 09:52:48 ouster Exp $ SPRITE (Berkeley)
  22. '/" 
  23. .so man.macros
  24. .HS option tk
  25. .BS
  26. '\" Note:  do not modify the .SH NAME line immediately below!
  27. .SH NAME
  28. option \- Add/retrieve window options to/from the option database
  29. .SH SYNOPSIS
  30. \fBoption add \fIpattern value \fR?\fIpriority\fR?
  31. .sp
  32. \fBoption clear\fR
  33. .sp
  34. \fBoption get \fIwindow name class\fR
  35. .sp
  36. \fBoption readfile \fIfileName \fR?\fIpriority\fR?
  37. .BE
  38.  
  39. .SH DESCRIPTION
  40. .PP
  41. The \fBoption\fR command allows you to add entries to the Tk option
  42. database or to retrieve options from the database.  The \fBadd\fR
  43. form of the command adds a new option to the database.
  44. \fIPattern\fR contains
  45. the option being specified, and consists of names and/or classes
  46. separated by asterisks or dots, in the usual X format.  \fIValue\fR
  47. contains a text string to associate with \fIpattern\fR;  this is the
  48. value that will be returned in calls to \fBTk_GetOption\fR or by
  49. invocations of the \fBoption get\fR command.  If \fIpriority\fR
  50. is specified, it indicates the priority level for this option (see
  51. below for legal values);  it defaults to \fBinteractive\fR.
  52. This command always returns an empty string.
  53. .PP
  54. The \fBoption clear\fR command clears the option database.  Default
  55. options (from the
  56. \fBRESOURCE_MANAGER\fR property or the \fB.Xdefaults\fR
  57. file) will be reloaded automatically the next time an
  58. option is added to the database or removed from it.  This command
  59. always returns an empty string.
  60. .PP
  61. The \fBoption get\fR command returns the value of the option
  62. specified for \fIwindow\fR
  63. under \fIname\fR and \fIclass\fR.  If several entries in the option
  64. database match \fIwindow\fR, \fIname\fR, and \fIclass\fR, then
  65. the command returns whichever was created with highest
  66. \fIpriority\fR level.  If there are several matching
  67. entries at the same priority level, then it returns whichever entry
  68. was most recently entered into the option database.  If there are
  69. no matching entries, then the empty string is returned.
  70. .PP
  71. The \fBreadfile\fR form of the command reads \fIfileName\fR,
  72. which should have the standard format for an
  73. X resource database such as \fB.Xdefaults\fR, and adds all the
  74. options specified in that file to the option database.  If \fIpriority\fR
  75. is specified, it indicates the priority level at which to enter the
  76. options;  \fIpriority\fR defaults to \fBinteractive\fR.
  77. .PP
  78. The \fIpriority\fR arguments to the \fBoption\fR command are
  79. normally specified symbolically using one of the following values:
  80. .TP
  81. \fBwidgetDefault\fR
  82. Level 20.  Used for default values hard-coded into widgets.
  83. .TP
  84. \fBstartupFile\fR
  85. Level 40.  Used for options specified in application-specific
  86. startup files.
  87. .TP
  88. \fBuserDefault\fR
  89. Level 60.  Used for options specified in user-specific defaults
  90. files, such as \fB.Xdefaults\fR, resource databases loaded into
  91. the X server, or user-specific startup files.
  92. .TP
  93. \fBinteractive\fR
  94. Level 80.  Used for options specified interactively after the application
  95. starts running.  If \fIpriority\fR isn't specified, it defaults to
  96. this level.
  97. .LP
  98. Any of the above keywords may be abbreviated.  In addition, priorities
  99. may be specified numerically using integers between 0 and 100,
  100. inclusive.  The numeric form is probably a bad idea except for new priority
  101. levels other than the ones given above.
  102.  
  103. .SH KEYWORDS
  104. database, option, priority, retrieve
  105.