📄 grid.n
字号:
'\"'\" Copyright (c) 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.'\" '\" SCCS: @(#) grid.n 1.15 96/12/13 16:46:35'\" .so man.macros.TH grid n 4.1 Tk "Tk Built-In Commands".BS'\" Note: do not modify the .SH NAME line immediately below!.SH NAMEgrid \- Geometry manager that arranges widgets in a grid.SH SYNOPSIS\fBgrid \fIoption arg \fR?\fIarg ...\fR?.BE.SH DESCRIPTION.PPThe \fBgrid\fR command is used to communicate with the gridgeometry manager that arranges widgets in rows and columns insideof another window, called the geometry master (or master window).The \fBgrid\fR command can have any of several forms, dependingon the \fIoption\fR argument:.TP\fBgrid \fIslave \fR?\fIslave ...\fR? ?\fIoptions\fR?If the first argument to \fBgrid\fR is a window name (any valuestarting with ``.''), then the command is processed in the sameway as \fBgrid configure\fR..TP\fBgrid bbox \fImaster\fR ?\fIcolumn row\fR? ?\fIcolumn2 row2\fR?With no arguments, the bounding box (in pixels) of the grid is returned.The return value consists of 4 integers. The first two are the pixeloffset from the master window (x then y) of the top-left corner of thegrid, and the second two integers are the width and height of the grid,also in pixels. If a single \fIcolumn\fP and \fIrow\fP is specified on the command line, then the bounding box for that cell is returned, where thetop left cell is numbered from zero. If both \fIcolumn\fP and \fIrow\fParguments are specified, then the bounding box spanning the rows and columnsindicated is returned..TP\fBgrid columnconfigure \fImaster index \fR?\fI\-option value...\fR?Query or set the column properties of the \fIindex\fP column of the geometry master, \fImaster\fP.The valid options are \fB\-minsize\fP, \fB\-weight\fP and \fB-pad\fP..VSIf one or more options are provided, then \fIindex\fP may be given as a list of column indeces to which the configuration options will operate on..VEThe \fB\-minsize\fP option sets the minimum size, in screen units,that will be permitted for this column.The \fB\-weight\fP option (an integer value)sets the relative weight for apportioningany extra spaces amongcolumns.A weight of zero (0) indicates the column will not deviate from its requestedsize. A column whose weight is two will grow at twice the rate as a columnof weight one when extra space is allocated to the layout.The \fB-pad\fP option specifies the number of screen units that will beadded to the largest window contained completely in that column when thegrid geometry manager requests a size from the containing window.If only an option is specified, with no value,the current value of that option is returned.If only the master window and index is specified, all the current settingsare returned in an list of "-option value" pairs..TP\fBgrid configure \fIslave \fR?\fIslave ...\fR? ?\fIoptions\fR?The arguments consist of the names of one or more slave windowsfollowed by pairs of arguments that specify howto manage the slaves.The characters \fB\-\fP, \fBx\fP and \fB^\fP, can be specified instead of a window name to alter the defaultlocation of a \fIslave\fP, as described in the ``RELATIVE PLACEMENT''section, below.The following options are supported:.RS.TP\fB\-column \fIn\fRInsert the slave so that it occupies the \fIn\fPth column in the grid.Column numbers start with 0. If this option is not supplied, then theslave is arranged just to the right of previous slave specified on thiscall to \fIgrid\fP, or column "0" if it is the first slave. For each\fBx\fP that immediately precedes the \fIslave\fP, the column positionis incremented by one. Thus the \fBx\fP represents a blank columnfor this row in the grid..TP\fB\-columnspan \fIn\fRInsert the slave so that it occupies \fIn\fP columns in the grid.The default is one column, unless the window name is followed by a\fB\-\fP, in which case the columnspan is incremented once for each immediatelyfollowing \fB\-\fP..TP\fB\-in \fIother\fRInsert the slave(s) in the masterwindow given by \fIother\fR. The default is the first slave'sparent window..TP\fB\-ipadx \fIamount\fRThe \fIamount\fR specifies how much horizontal internal padding toleave on each side of the slave(s). This is space is addedinside the slave(s) border.The \fIamount\fR must be a valid screen distance, such as \fB2\fR or \fB.5c\fR.It defaults to 0..TP\fB\-ipady \fIamount\fRThe \fIamount\fR specifies how much vertical internal padding toleave on on the top and bottom of the slave(s).This space is added inside the slave(s) border.The \fIamount\fR defaults to 0..TP\fB\-padx \fIamount\fRThe \fIamount\fR specifies how much horizontal external padding toleave on each side of the slave(s), in screen units.The \fIamount\fR defaults to 0.This space is added outside the slave(s) border..TP\fB\-pady \fIamount\fRThe \fIamount\fR specifies how much vertical external padding toleave on the top and bottom of the slave(s), in screen units.The \fIamount\fR defaults to 0.This space is added outside the slave(s) border..TP\fB\-row \fIn\fRInsert the slave so that it occupies the \fIn\fPth row in the grid.Row numbers start with 0. If this option is not supplied, then theslave is arranged on the same row as the previous slave specified on thiscall to \fBgrid\fP, or the first unoccupied row if this is the first slave..TP\fB\-rowspan \fIn\fRInsert the slave so that it occupies \fIn\fP rows in the grid.The default is one row. If the next \fBgrid\fP command contains\fB^\fP characters instead of \fIslaves\fP that line up with the columnsof this \fIslave\fP, then the \fBrowspan\fP of this \fIslave\fP isextended by one..TP\fB\-sticky \fIstyle\fRIf a slave's cell is larger than its requested dimensions, thisoption may be used to position (or stretch) the slave within its cell.\fIStyle\fR is a string that contains zero or more of the characters\fBn\fP, \fBs\fP, \fBe\fP or \fBw\fP.The string can optionally contains spaces orcommas, but they are ignored. Each letter refers to a side (north, south,east, or west) that the slave will "stick" to. If both \fBn\fP and \fBs\fP (or\fBe\fP and \fBw\fP) are specified, the slave will be stretched to fill the entireheight (or width) of its cavity. The \fBsticky\fP option subsumes thecombination of \fB\-anchor\fP and \fB\-fill\fP that is used by \fBpack\fP.The default is \fB{}\fP, which causes the slave to be centered in its cavity,at its requested size..LPIf any of the slaves are already managed by the geometry managerthen any unspecified options for them retain their previous values ratherthan receiving default values..RE.TP\fBgrid forget \fIslave \fR?\fIslave ...\fR?Removes each of the \fIslave\fRs from grid for itsmaster and unmaps their windows.The slaves will no longer be managed by the grid geometry manager.The configuration options for that window are forgotten, so that if theslave is managed once more by the grid geometry manager, the initialdefault settings are used..TP\fBgrid info \fIslave\fRReturns a list whose elements are the current configuration state ofthe slave given by \fIslave\fR in the same option-value form thatmight be specified to \fBgrid configure\fR.The first two elements of the list are ``\fB\-in \fImaster\fR'' where
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -