⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 optionmenu.n

📁 这是一个Linux下的集成开发环境
💻 N
字号:
'\"'\" Copyright (c) 1995 DSC Technologies Corporation'\"'\" See the file "license.terms" for information on usage and redistribution'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.'\"'\" @(#) optionmenu.n 1.21 94/12/17 16:04:44'/" .so man.macros.HS optionmenu iwid.BS'\" Note:  do not modify the .SH NAME line immediately below!.SH NAMEoptionmenu \- Create and manipulate a option menu widget.SH SYNOPSIS\fBoptionmenu\fI \fIpathName \fR?\fIoptions\fR?.SH "INHERITANCE"itk::Widget <- Labeledwidget <- optionmenu.SH "STANDARD OPTIONS".LP.nf.ta 4c 8c 12c\fBactiveBackground\fR	\fBactiveBorderWidth\fR	\fBactiveForeground\fR	\fBbackground\fR\fBborderWidth\fR	\fBcursor\fR	\fBdisabledForeground\fR	\fBfont\fR\fBforeground\fR	\fBhighlightColor\fR	\fBhighlightThickness\fR	\fBrelief\fR.fi.LPSee the "options" manual entry for details on the standard options..SH "INHERITED OPTIONS".LP.nf.ta 4c 8c 12c\fBdisabledForeground\fR	\fBlabelBitmap\fR	\fBlabelFont\fR	\fBlabelImage\fR\fBlabelMargin\fR	\fBlabelPos\fR	\fBlabelText\fR	\fBlabelVariable\fR\fBstate\fR.fi.LPSee the "LabeledWidget" manual entry for details on the inherited options..SH "WIDGET-SPECIFIC OPTIONS".LP.nfName:	\fBclickTime\fRClass:	\fBClickTime\fRCommand-Line Switch:	\fB-clicktime\fR.fi.IPInterval time, in msec, used to determine that a single mouse click has occurred. Used to post menu on a "quick" mouse click.\fBNote\fR: changing this value may cause the sigle-click functionality to not work properly.  The default is 150 msec..LP.nfName:	\fBcommand\fRClass:	\fBCommand\fRCommand-Line Switch:	\fB-command\fR.fi.IPSpecifies a Tcl command procedure to be evaluated following a  change in the current option menu selection..LP.nfName:	\fBcyclicOn\fRClass:	\fBCyclicOn\fRCommand-Line Switch:	\fB-cyclicon\fR.fi.IPTurns on/off the 3rd mouse button capability. The value may be specifiedin any of the forms acceptable to \fBTcl_GetBoolean\fR.  This featureallows the right mouse button to cycle through the popup menu list without poping it up. The right mouse button cycles throughthe menu in reverse order.  The default is true..LP.nfName:	\fBpopupCursor\fRClass:	\fBCursor\fRCommand-Line Switch:	\fB-popupcursor\fR.fi.IPSpecifies  the mouse cursor to be used for the popup menu.  The value may have any of the  forms  acceptable to \fBTk_GetCursor\fR..LP.nfName:	\fBstate\fRClass:	\fBState\fRCommand-Line Switch:	\fB-state\fR.fi.IPSpecified one of two states for the optionmenu: \fBnormal\fR, or\fBdisabled\fR.  If the optionmenu is disabled, then option menuselection is ignored..LP.nfName:	\fBwidth\fRClass:	\fBWidth\fRCommand-Line Switch:	\fB-width\fR.fi.IPSpecifies a fixed size for the menu button label in any of the formsacceptable to \Tk_GetPixels\fR.  If the textis too small to fit in the label, the text is clipped. Note: Normally, when a new list is created, or new items are added to an existing list, the menu button label is resized automatically.  Setting this option overrides that functionality..LP.BE.SH DESCRIPTION.PPThe \fBoptionmenu\fR command creates an option menu widget with options to manage it.  An option menu displays a frame containing a label and a button.A pop-up menu will allow for the value of the button to change..SH "METHODS".PPThe \fBoptionmenu\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:.DS \fIpathName option \fR?\fIarg arg ...\fR?.DE\fIOption\fR and the \fIarg\fRsdetermine the exact behavior of the command.  .PPMany of the widget commands for an optionmenu take as one argument anindicator of which entry of the option menu to operate on.  Theseindicators are called \fIindex\fRes and may be specified inany of the following forms:.TP 12\fInumber\fRSpecifies the entry numerically, where 0 correspondsto the top-most entry of the option menu, 1 to the entry below it, andso on..TP 12\fBend\fRIndicates the bottommost entry in the menu.  If there are noentries in the menu then zero is returned..TP 12\fBselect\fRReturns the numerical index of the currently selected option menu entry.If no entries exist in the menu, then -1 is returned..TP 12\fIpattern\fRIf the index doesn't satisfy one of the above forms then thisform is used.  \fIPattern\fR is pattern-matched against the label ofeach entry in the option menu, in order from the top down, until amatching entry is found.  The rules of \fBTcl_StringMatch\fRare used..PPThe following widget commands are possible for optionmenu widgets:.SH "WIDGET-SPECIFIC METHODS".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 \fBoptionmenu\fRcommand..TP\fIpathName\fR \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 \fBoptionmenu\fRcommand..TP\fIpathName \fBdelete \fIfirst\fR ?\fIlast\fR?Delete all of the option menu entries between \fIfirst\fR and\fIlast\fR inclusive.  If \fIlast\fR is omitted then it defaults to \fIfirst\fR..TP\fIpathName \fBdisable \fIindex\fRDisable the option menu entry specified by \fIindex\fR. Disabling a menu item will prevent the user from being able to select this item from the menu.  This only effects the state of the item in the menu, in other words, should the item be the currently selected item, the programmer is responsible for determining this condition and taking appropriate action..TP\fIpathName \fBenable \fIindex\fREnable the option menu entry specified by \fIindex\fR.Enabling a menu item allows the user to select this item from the menu..TP\fIpathName \fBget\fR ?\fIfirst\fR? ?\fIlast\fR?If no arguments are specified, this operation returns the currentlyselected option menu item.  Otherwise, it returns the name of theoption at index \fIfirst\fR, or a range of options between \fIfirst\fRand \fIlast\fR..TP\fIpathName \fBindex \fIindex\fRReturns the numerical index corresponding to \fIindex\fR..TP\fIpathName \fBinsert \fIindex string\fR ?\fIstring\fR?Insert an item, or list of items, into the menu at location \fIindex\fR..TP\fIpathName \fBselect \fIindex\fRSelect an item from the option menu to be displayed as the currently selected item..TP\fIpathName \fBsort \fImode\fRSort the current menu in either \fBascending\fR, or \fBdescending\fR order.The values \fBincreasing\fR, or \fBdecreasing\fR are also accepted..SH "COMPONENTS".LP.nfName:	\fBmenuBtn\fRClass:	\fBMenubutton\fR.fi.IPThe menuBtn component is the option menu button which displays the currentchoice from the popup menu.  See the "menubutton" widget manual entryfor details on the menuBtn component item..LP.nfName:	\fBpopupMenu\fRClass:	\fBMenu\fR.fi.IPThe popupMenu component is menu displayed upon selection of the menu button.The menu contains the choices for the option menu.  See the "menu" widget manual entry for details on the popupMenu component item..fi.SH EXAMPLE.DS optionmenu .om -labelmargin 5 \\     -labelon true -labelpos w -labeltext "Operating System :" .om insert end Unix VMS Linux OS/2 {Windows NT} DOS .om sort ascending .om select Linux pack .om  -padx 10 -pady 10.DE.SH ACKNOWLEDGEMENTS:Michael J. McLennan.IPBorrowed some ideas (next & previous) from OptionButton class. .LPSteven B. Jaggers.IPProvided an initial prototype in [incr Tcl]..LPBret Schuhmacher.IPHelped with popup menu functionality..LP.SH AUTHORAlfredo Jahn.SH KEYWORDSoptionmenu, widget

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -