home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / TCL / BLT / BLT1.7L1 / BLT1 / blt-1.7 / man / table.man < prev    next >
Encoding:
Text File  |  1994-04-01  |  16.0 KB  |  379 lines

  1. '\"
  2. '\" Copyright 1991-1994 by AT&T Bell Laboratories.
  3. '\"
  4. '\" Permission to use, copy, modify, and distribute this software
  5. '\" and its documentation for any purpose and without fee is hereby
  6. '\" granted, provided that the above copyright notice appear in all
  7. '\" copies and that both that the copyright notice and warranty
  8. '\" disclaimer appear in supporting documentation, and that the
  9. '\" names of AT&T Bell Laboratories any of their entities not be used
  10. '\" in advertising or publicity pertaining to distribution of the
  11. '\" software without specific, written prior permission.
  12. '\"
  13. '\" AT&T disclaims all warranties with regard to this software, including
  14. '\" all implied warranties of merchantability and fitness.  In no event
  15. '\" shall AT&T be liable for any special, indirect or consequential
  16. '\" damages or any damages whatsoever resulting from loss of use, data
  17. '\" or profits, whether in an action of contract, negligence or other
  18. '\" tortuous action, arising out of or in connection with the use or
  19. '\" performance of this software.
  20. '\"
  21. '\" Table geometry manager created by George Howlett.
  22. '\"
  23. .so man.macros
  24. .HS blt_table cmds
  25. .BS
  26. '\" Note:  do not modify the .SH NAME line immediately below!
  27. .SH NAME
  28. blt_table \- Geometry manager that arranges windows in a table
  29. .SH SYNOPSIS
  30. .sp
  31. \fBblt_table \fImaster\fR ?\fIslave index options\fR?...
  32. .sp
  33. \fBblt_table column \fImaster option\fR ?\fIargs\fR...?
  34. .sp
  35. \fBblt_table configure \fIslave\fR ?\fIslave\fR...? ?\fIoptions\fR...?
  36. .sp
  37. \fBblt_table row \fImaster option\fR ?\fIargs\fR...?
  38. .sp
  39. \fBblt_table forget \fIslave\fR ?\fIslave\fR...?
  40. .sp
  41. \fBblt_table info \fIslave\fR
  42. .sp
  43. \fBblt_table slaves \fImaster\fR ?\fIpattern\fR?
  44. .sp
  45. \fBblt_table masters\fR ?\fIpattern\fR?
  46. .BE
  47. .SH DESCRIPTION
  48. .PP
  49. The \fBblt_table\fR command is a geometry manager for Tk. It arranges 
  50. windows tabularly in
  51. a window called the \fImaster\fR.  The table consists of individual
  52. rows and columns whose spacing define its layout. Windows, called 
  53. \fIslaves\fR, are positioned in the table by specifying the row and column.
  54. Only one slave can be specified at a single position in the table.  But slaves 
  55. may span multiple rows and columns.
  56. .PP
  57. By default, \fBblt_table\fR tries to arrange all its slaves in the minimum 
  58. space required. It determines this by querying each slave window for
  59. its requested size.  The maximum requested height all slaves spanning a 
  60. particular row is the row's normal size.  Similarly, the maximum 
  61. requested width of all slaves spanning a particular column is the column's 
  62. normal size.  This, in turn, specifies the table's size, which 
  63. is the sum of the normal sizes of the rows and columns.
  64. The number of rows and columns a table contains
  65. is determined by the indices specified.  
  66. There is no mechanism to delete a row or column.
  67. .SH TABLE INDICES
  68. An \fIindex\fR references a row,column position in the table.
  69. It must be in the form "\fIrow\fR,\fIcolumn\fR" where \fIrow\fR and 
  70. \fIcolumn\fR are the respective row and column
  71. numbers, starting from zero  (0,0 is the upper leftmost  position). 
  72. \fIRow\fR and \fIcolumn\fR may also be numeric expressions which are 
  73. recursively evaluated.  
  74. .SH SIZE CONSTRAINTS
  75. You can limit the amount of space requested by a slave window.
  76. By specifying both a minimum and maximum limit in which the window's 
  77. requested size must fall, you can bound a window's size.  This affects
  78. the calculation of the normal size of all rows and columns which
  79. it spans. In a similar fashion, you can directly control the 
  80. normal size of any row or column. 
  81. .PP
  82. This provides two features.
  83. Slave windows must be contained within the rows and columns they are 
  84. defined to span.  By limiting the size of a row or column, you control 
  85. the size of all windows in spanning it. This overrides whatever
  86. size the slave has requested.  Secondly, there's no requirement 
  87. that a row or column contain any slaves. This means you can create 
  88. horizontal or vertical spacing by simply setting the row or column limits.
  89. .SH RESIZING
  90. \fBBlt_table\fR tries to fit itself exactly in the master window.  It first
  91. tries to change the size of the master to the table's normal size.
  92. If this fails, it then tries to expand or shrink itself to the size of 
  93. the master.
  94. If normal size of the table is smaller than the master window, the 
  95. extra space is evenly divided among the rows or columns. If it's larger, 
  96. then the row and columns are shrunk to fit in the master window.  In both 
  97. cases, the rows and column sizes are changed with respect to their constraints.
  98. .PP
  99. You can also specify how an individual row or column is to be resized. 
  100. For example, a column may be set to one of four modes:
  101. .RS
  102. .IP \fBnone\fR
  103. Don't resize the column.
  104. .IP \fBexpand\fR
  105. Allow the column to only grow greater than its normal width.
  106. .IP \fBshrink\fR
  107. Allow the column to only shrink less than its normal width.
  108. .IP \fBboth\fR
  109. Resize the column in either direction.
  110. .RE
  111. .SH CREATING A TABLE
  112. Tables are created by invoking the \fBblt_table\fR command.
  113. .DS
  114.     \fBblt_table\fR \fImaster\fR
  115. .DE
  116. \fIMaster\fR is the pathname of a window which must already exist.
  117. \fBBlt_table\fR will arrange its slave windows inside of \fImaster\fR.
  118. Slave windows are added by designating the slave window's pathname and 
  119. table position.
  120. .DS
  121.     \fBblt_table\fR \fImaster slave index\fR
  122. .DE
  123. .SH TABLE COMMANDS
  124. The following commands are available for the \fBblt_table\fR:
  125. .TP
  126. \fBblt_table \fImaster\fR ?\fIslave index options\fR?...
  127. Adds the window \fIslave\fR to the table associated with \fImaster\fR.
  128. If a table doesn't exist for \fImaster\fR, one is created.
  129. \fIMaster\fR is the pathname of the window in which the slave windows
  130. will be arranged. \fISlave\fR is the pathname of the window to be arranged
  131. inside of \fImaster\fR at the position designated by \fIindex\fR.
  132. This command returns the empty string.  
  133. \fIOption\fR may have any of the values accepted by the 
  134. \fBblt_table configure\fR command.
  135. .TP
  136. \fBblt_table column \fImaster \fBconfigure \fIcolumnIndex\fR ?\fIoptions...\fR?
  137. Queries or modifies the configuration options of the columns specified.
  138. \fIColumnIndex\fR may be in one of two forms; \fBall\fR 
  139. (indicating all columns) or a list of the column indices to be configured.  
  140. \fIOptions\fR may have any of the following values:
  141. .RS
  142. .TP
  143. \fB\-padx \fIpixels\fR
  144. Specifies an extra padding to the normal width of the column.
  145. \fIPixels\fR can be any value accepted by \fBTk_GetPixels\fR.
  146. The default padding is \fB0\fR.
  147. .TP
  148. \fB\-resize \fImode\fR
  149. Indicates that the column can expand or shrink from its normal width 
  150. when the table is resized.
  151. \fIMode\fR must be one of the following:
  152. \fBnone\fR, \fBexpand\fR, \fBshrink\fR, or \fBboth\fR.  If \fImode\fR is 
  153. \fBexpand\fR the width of the column is expanded if there is extra space
  154. in the master window. If \fIstyle\fR is \fBshrink\fR its width may be
  155. reduced beyond its normal width if there is not enough space in the master.
  156. The default is \fBnone\fR.
  157. .TP
  158. \fB\-width \fIwidth\fR
  159. Specifies the limits within which the width of the column may expand or 
  160. shrink.  
  161. \fIWidth\fR is a list of bounding values.  See the section 
  162. .SB BOUNDING LIST FORMAT
  163. for a description of this list.
  164. By default there are no constraints.
  165. .RE
  166. .TP
  167. \fBblt_table column \fImaster\fB dimension\fR
  168. Returns the number of columns in the table.
  169. .TP
  170. \fBblt_table column \fImaster \fBinfo\fI columnIndex\fR 
  171. Returns a list of the configuration options for the columns specified.
  172. \fIColumnIndex\fR may be in one of two forms; \fBall\fR 
  173. (indicating all columns) or a list of column indices.
  174. The column indices may themselves be numeric expressions.
  175. .TP
  176. \fBblt_table column \fImaster\fB sizes\fI columnIndex\fR
  177. Returns the sizes of the given columns in the table.
  178. \fIColumnIndex\fR may be in one of two forms; \fBall\fR 
  179. (indicating all columns) or a list of column indices. 
  180. The column indices may themselves be numeric expressions.
  181. .TP
  182. \fBblt_table configure\fR \fIslave\fR ?\fIslave\fR...? ?\fIoptions\fR...? 
  183. Queries or modifies the configuration options of a slave in a table.  
  184. If no \fIoption\fR is specified, returns a list describing all of the
  185. available options for \fIslave\fR (see \fBTk_ConfigureInfo\fR for
  186. information on the format of this list).  \fISlave\fR must be
  187. the pathname of a window already managed by the \fBblt_table\fR.
  188. If \fIoption\fR is specified with no \fIvalue\fR, then the command 
  189. returns a list describing the
  190. one named option (this list will be identical to the corresponding
  191. sublist of the value returned if no \fIoption\fR is specified).  
  192. If one or more \fIoption\-value\fR pairs are specified, then the command
  193. modifies the given option(s) to have the given value(s); in
  194. this case the command returns the empty string.  
  195. One of more slave windows can be modified (with the 
  196. same options) at the same time.
  197. The following configuration 
  198. options are valid:
  199. .RS
  200. .TP
  201. \fB\-anchor \fIanchorPos\fR
  202. Specifies how the slave window will be arranged if there is extra space 
  203. in the span surrounding the window. \fIAnchorpos\fR may have any of the 
  204. forms accepted by \fBTk_GetAnchor\fR.  For example, if \fIanchorPos\fR is 
  205. \fBcenter\fR then the window is centered in the rows and columns it spans; 
  206. if \fIanchorPos\fR is \fBw\fR then the window will be drawn such it touches
  207. the leftmost edge of the span. This option defaults to \fBcenter\fR.
  208. .TP
  209. \fB\-columnspan \fInumber\fR
  210. Specifies the number of columns spanned by the slave. The default span
  211. is \fB1\fR.
  212. .TP
  213. \fB\-fill \fIstyle\fR
  214. Indicates if the slave should be expanded to occupy any extra space 
  215. in the span.  \fIStyle\fR must be one of the following:
  216. \fBnone\fR, \fBx\fR, \fBy\fR, \fBboth\fR.  If \fIstyle\fR is \fBx\fR,
  217. the width slave window is expanded.  If \fIstyle\fR is \fBy\fR, the
  218. height is expanded. The default is \fBnone\fR.
  219. .TP
  220. \fB\-ipadx \fIpixels\fR
  221. Specifies an extra padding in addition to the width requested by the 
  222. slave window. \fIPixels\fR can be any value accepted by \fBTk_GetPixels\fR.
  223. The default is \fB0\fR.
  224. .TP
  225. \fB\-ipady \fIpixels\fR
  226. Specifies an extra padding in addition to the height requested by the slave window. \fIPixels\fR can be any value accepted by \fBTk_GetPixels\fR.
  227. The default is \fB0\fR.
  228. .TP 
  229. \fB\-padx \fIpixels\fR
  230. Specifies an extra padding to the width of the span occupying the slave window. 
  231. \fIPixels\fR can be any value accepted by \fBTk_GetPixels\fR.
  232. The default is \fB0\fR.
  233. .TP
  234. \fB\-pady \fIpixels\fR
  235. Specifies an extra padding to the height of the span occupying the slave window.
  236. \fIPixels\fR can be any value accepted by \fBTk_GetPixels\fR.
  237. The default is \fB0\fR.
  238. .TP
  239. \fB\-reqheight \fIheight\fR
  240. Specifies limits for the requested height of the slave window. These limits 
  241. also constrain the amount of internal padding given to the slave. 
  242. \fIHeight\fR is a list of bounding values.  See the section 
  243. .SB BOUNDING LIST FORMAT
  244. for a description of this list.
  245. By default there are no constraints.
  246. .TP
  247. \fB\-reqwidth \fIwidth\fR
  248. Specifies the limits of the width which a slave may request. These limits 
  249. also affect the amount of internal padding given to the slave.
  250. \fIWidth\fR is a list of bounding values.  See the section 
  251. .SB BOUNDING LIST FORMAT
  252. for a description of this list.
  253. By default there are no constraints.
  254. .TP
  255. \fB\-rowspan \fInumber\fR
  256. Specifies the number of rows spanned by the slave window. The default span
  257. is \fB1\fR.
  258. .RE
  259. .TP
  260. \fBblt_table forget \fIslave\fR 
  261. Requests that \fIslave\fR no longer have its geometry managed.
  262. \fISlave\fR is the pathname of the window currently 
  263. managed by some table. The window will be unmapped so that it no longer 
  264. appears on the screen.  If \fIslave\fR is not currently managed by any table, 
  265. an error message is returned, otherwise the empty string.
  266. .TP
  267. \fBblt_table info \fIslave\fR 
  268. Returns a list of the current non-default configuration options of for 
  269. \fIslave\fR.  \fISlave\fR is the pathname of the window currently managed 
  270. by some table.  The list is exactly in the form that might be specified to
  271. \fBblt_table configure\fR command.
  272. If \fIslave\fR is not currently managed by any table, an error
  273. message is returned.
  274. .TP
  275. \fBblt_table masters \fR?\fIpattern\fR?
  276. Returns a list of pathnames for all master windows matching \fIpattern\fR.  
  277. If the \fIpattern\fR argument is not present, then the names of all the master 
  278. windows are returned.
  279. .TP
  280. \fBblt_table row \fImaster\fB configure\fI row\fR ?\fIoptions...\fR?
  281. Queries or modifies the configuration options of the row specified 
  282. by \fIrow\fR. \fIRow\fR may be in one of two forms; \fBall\fR 
  283. (indicating all rows) or a list of the row indices to be configured.  
  284. \fIOption\fR may have any of the values accepted by the following:
  285. .RS
  286. .TP
  287. \fB\-height \fIheight\fR
  288. Specifies the limits of the height which the row may expand or shrink to. 
  289. \fIHeight\fR is a list of bounding values.  See the section 
  290. .SB BOUNDING LIST FORMAT
  291. for a description of this list.
  292. By default there are no constraints.
  293. .TP
  294. \fB\-pady \fIpixels\fR
  295. Specifies an extra padding to the normal height of the row.
  296. \fIPixels\fR can be any value accepted by \fBTk_GetPixels\fR.
  297. The default padding is \fB0\fR.
  298. .TP
  299. \fB\-resize \fImode\fR
  300. Indicates that the row can expand or shrink from its normal height 
  301. when the table is resized.
  302. \fIMode\fR must be one of the following:
  303. \fBnone\fR, \fBexpand\fR, \fBshrink\fR, or \fBboth\fR.  If \fImode\fR is 
  304. \fBexpand\fR the height of the row is expanded if there is extra space
  305. in the master window. If \fIstyle\fR is \fBshrink\fR its height may be
  306. reduced beyond its normal height if there is not enough space in the master.
  307. The default is \fBnone\fR.
  308. .RE
  309. .TP
  310. \fBblt_table row \fImaster\fB dimension\fR
  311. Returns the number of rows in the table.
  312. .TP
  313. \fBblt_table row \fImaster\fB info\fI row\fR ?\fIoptions...\fR?
  314. Returns a list of the configuration options for the rows specified.
  315. \fIRowIndex\fR may be in one of two forms; \fBall\fR 
  316. (indicating all rows) or a list of row indices.
  317. The row indices may themselves be numeric expressions.
  318. .TP
  319. \fBblt_table row \fImaster\fB sizes\fI rowIndex\fR
  320. Returns the sizes of the given rows in the table.
  321. \fIRowIndex\fR may be in one of two forms; \fBall\fR 
  322. (indicating all rows) or a list of the row indices.
  323. .TP
  324. \fBblt_table slaves \fImaster\fR ?\fIpattern\fR?
  325. Returns a list of pathnames for all slave windows managed by 
  326. \fImaster\fR matching \fIpattern\fR.  If the \fIpattern\fR argument is not
  327. present, then the names of all the slave windows are returned.
  328. \fIMaster\fR is the pathname of a master window.
  329. If \fImaster\fR is not the master window of any table, an error message 
  330. is returned.
  331. .SH BOUNDING LIST FORMAT
  332. Constraints for various options 
  333. (\fB-reqheight\fR, \fB-reqwidth\fR, \fB-height\fR, and \fB-width\fR) are 
  334. specified by supplying a bounding list of values.
  335. Each value must be in a form accepted by \fBTk_GetPixels\fR.
  336. The interpretation of this list is based upon the number of values it
  337. contains:
  338. .RS
  339. .IP "{\fI\fR}"
  340. Empty list. No bounding is performed.
  341. .IP "{\fI x \fR}"
  342. Set the size of the window or partition at \fIx\fR. The size of the partition 
  343. or window cannot grow or shrink.
  344. .IP "{\fI min max \fR}"
  345. Bound the size of the window or partition between \fImin\fR
  346. and \fImax\fR.
  347. .IP "{\fI min max nom\fR}"
  348. Bound the size of the window or partition between \fImin\fR
  349. and \fImax\fR.  In addition, set the normal size to \fInom\fR.
  350. .RE
  351. The maximum bound \fImax\fR can also be specified as \fCInf\fR
  352. to indicate a unlimited maximum bound.  This can be useful when you 
  353. wish only to set the minimum or nominal size of a window or partition.
  354. .SH EXAMPLE
  355. The following example arranges a canvas, two scrollbars, and a title
  356. in a frame.
  357. .DS
  358. \f(CWblt_table .frame \\
  359.     .title 0,0 -columnspan 2 -anchor center \\
  360.     .canvas 1,0 -fill both \\
  361.     .vscroll 1,1 -fill y \\
  362.     .hscroll 2,0 -fill x
  363. blt_table column .frame configure 1 -resize none
  364. blt_table row .frame configure 2 -resize none\fR
  365. .DE
  366. .sp 1
  367. The rows and columns containing the scrollbars are frozen at their normal
  368. size, so that even if the frame is resized, the scrollbars will remain
  369. the same width.
  370. .SH BUGS
  371. .VS
  372. There is no warning or error if a window is already a slave or master, 
  373. managed by another geometry manager (there currently is no way to properly 
  374. detect this).  Typically, the window will be repositioned by both geometry 
  375. managers, ad infinitum.  The only recourse is to avoid doing this.
  376. .VE
  377. .SH KEYWORDS
  378. frame, geometry manager, location, table, size
  379.