?? entry.n
字號:
'\"'\" 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.'\" '\" SCCS: @(#) entry.n 1.41 97/10/31 12:58:44'\" .so man.macros.TH entry n 4.1 Tk "Tk Built-In Commands".BS'\" Note: do not modify the .SH NAME line immediately below!.SH NAMEentry \- Create and manipulate entry widgets.SH SYNOPSIS\fBentry\fR \fIpathName \fR?\fIoptions\fR?.SO\-background \-highlightbackground \-insertontime \-selectforeground\-borderwidth \-highlightcolor \-insertwidth \-takefocus\-cursor \-highlightthickness \-justify \-textvariable\-exportselection \-insertbackground \-relief \-xscrollcommand\-font \-insertborderwidth \-selectbackground\-foreground \-insertofftime \-selectborderwidth.SE.SH "WIDGET-SPECIFIC OPTIONS".OP \-show show ShowIf this option is specified, then the true contents of the entryare not displayed in the window.Instead, each character in the entry's value will be displayed asthe first character in the value of this option, such as ``*''.This is useful, for example, if the entry is to be used to entera password.If characters in the entry are selected and copied elsewhere, theinformation copied will be what is displayed, not the true contentsof the entry..OP \-state state StateSpecifies one of two states for the entry: \fBnormal\fR or \fBdisabled\fR.If the entry is disabled then the value may not be changed using widgetcommands and no insertion cursor will be displayed, even if the input focus isin the widget..OP \-width width WidthSpecifies an integer value indicating the desired width of the entry window,in average-size characters of the widget's font.If the value is less than or equal to zero, the widget picks asize just large enough to hold its current text..BE.SH DESCRIPTION.PPThe \fBentry\fR command creates a new window (given by the\fIpathName\fR argument) and makes it into an entry widget.Additional options, described above, may be specified on thecommand line or in the option databaseto configure aspects of the entry such as its colors, font,and relief. The \fBentry\fR command returns its\fIpathName\fR argument. At the time this command is invoked,there must not exist a window named \fIpathName\fR, but\fIpathName\fR's parent must exist..PPAn entry is a widget that displays a one-line text string andallows that string to be edited using widget commands described below, whichare typically bound to keystrokes and mouse actions.When first created, an entry's string is empty.A portion of the entry may be selected as described below.If an entry is exporting its selection (see the \fBexportSelection\fRoption), then it will observe the standard X11 protocols for handling theselection; entry selections are available as type \fBSTRING\fR.Entries also observe the standard Tk rules for dealing with theinput focus. When an entry has the input focus it displays an\fIinsertion cursor\fR to indicate where new characters will beinserted..PPEntries are capable of displaying strings that are too long tofit entirely within the widget's window. In this case, only aportion of the string will be displayed; commands described belowmay be used to change the view in the window. Entries usethe standard \fBxScrollCommand\fR mechanism for interacting withscrollbars (see the description of the \fBxScrollCommand\fR optionfor details). They also support scanning, as described below..SH "WIDGET COMMAND".PPThe \fBentry\fR command creates a new Tcl command whosename is \fIpathName\fR. Thiscommand may be used to invoke variousoperations on the widget. It has the following general form:.CS\fIpathName option \fR?\fIarg arg ...\fR?.CE\fIOption\fR and the \fIarg\fRsdetermine the exact behavior of the command..PPMany of the widget commands for entries take one or more indices asarguments. An index specifies a particular character in the entry'sstring, in any of the following ways:.TP 12\fInumber\fRSpecifies the character as a numerical index, where 0 correspondsto the first character in the string..TP 12\fBanchor\fRIndicates the anchor point for the selection, which is set with the\fBselect from\fR and \fBselect adjust\fR widget commands..TP 12\fBend\fRIndicates the character just after the last one in the entry's string.This is equivalent to specifying a numerical index equal to the lengthof the entry's string..TP 12\fBinsert\fRIndicates the character adjacent to and immediately following theinsertion cursor..TP 12\fBsel.first\fRIndicates the first character in the selection. It is an error touse this form if the selection isn't in the entry window..TP 12\fBsel.last\fRIndicates the character just after the last one in the selection.It is an error to use this form if the selection isn't in theentry window..TP 12\fB@\fInumber\fRIn this form, \fInumber\fR is treated as an x-coordinate in theentry's window; the character spanning that x-coordinate is used.For example, ``\fB@0\fR'' indicates the left-most character in thewindow..LPAbbreviations may be used for any of the forms above, e.g. ``\fBe\fR''or ``\fBsel.f\fR''. In general, out-of-range indices are automaticallyrounded to the nearest legal value..PPThe following commands are possible for entry widgets:.TP\fIpathName \fBbbox \fIindex\fRReturns a list of four numbers describing the bounding box of thecharacter given by \fIindex\fR.The first two elements of the list give the x and y coordinates ofthe upper-left corner of the screen area covered by the character(in pixels relative to the widget) and the last two elements givethe width and height of the character, in pixels.The bounding box may refer to a region outside the visible areaof the window..TP\fIpathName \fBcget\fR \fIoption\fRReturns the current value of the configuration option givenby \fIoption\fR.\fIOption\fR may have any of the values accepted by the \fBentry\fRcommand..TP\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?Query or modify the configuration options of the widget.If no \fIoption\fR is specified, returns a list describing all ofthe available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR forinformation on the format of this list). If \fIoption\fR is specifiedwith no \fIvalue\fR, then the command returns a list describing theone named option (this list will be identical to the correspondingsublist of the value returned if no \fIoption\fR is specified). Ifone or more \fIoption\-value\fR pairs are specified, then the commandmodifies the given widget option(s) to have the given value(s); inthis case the command returns an empty string.\fIOption\fR may have any of the values accepted by the \fBentry\fRcommand..TP\fIpathName \fBdelete \fIfirst \fR?\fIlast\fR?Delete one or more elements of the entry.\fIFirst\fR is the index of the first character to delete, and\fIlast\fR is the index of the character just after the lastone to delete.If \fIlast\fR isn't specified it defaults to \fIfirst\fR+1,i.e. a single character is deleted.This command returns an empty string..TP\fIpathName \fBget\fRReturns the entry's string..TP\fIpathName \fBicursor \fIindex\fRArrange for the insertion cursor to be displayed just before the charactergiven by \fIindex\fR. Returns an empty string..TP\fIpathName \fBindex\fI index\fRReturns the numerical index corresponding to \fIindex\fR..TP\fIpathName \fBinsert \fIindex string\fRInsert the characters of \fIstring\fR just before the characterindicated by \fIindex\fR. Returns an empty string..TP\fIpathName \fBscan\fR \fIoption args\fRThis command is used to implement scanning on entries. It hastwo forms, depending on \fIoption\fR:.RS.TP\fIpathName \fBscan mark \fIx\fRRecords \fIx\fR and the current view in the entry window; used inconjunction with later \fBscan dragto\fR commands. Typically thiscommand is associated with a mouse button press in the widget. Itreturns an empty string..TP\fIpathName \fBscan dragto \fIx\fRThis command computes the difference between its \fIx\fR argumentand the \fIx\fR argument to the last \fBscan mark\fR command forthe widget. It then adjusts the view left or right by 10 times thedifference in x-coordinates. This command is typically associatedwith mouse motion events in the widget, to produce the effect ofdragging the entry at high speed through the window. The returnvalue is an empty string..RE.TP
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -