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

📄 menu.n

📁 linux系统下的音频通信
💻 N
📖 第 1 页 / 共 3 页
字号:
'\"'\" Copyright (c) 1990-1994 The Regents of the University of California.'\" Copyright (c) 1994-1997 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: @(#) menu.n 1.61 97/10/31 12:58:40'\" .so man.macros.TH menu n 4.1 Tk "Tk Built-In Commands".BS'\" Note:  do not modify the .SH NAME line immediately below!.SH NAMEmenu \- Create and manipulate menu widgets.SH SYNOPSIS\fBmenu\fR \fIpathName \fR?\fIoptions\fR?.SO\-activebackground	\-background	\-disabledforeground	\-relief\-activeborderwidth	\-borderwidth	\-font	\-takefocus\-activeforeground	\-cursor	\-foreground.SE.SH "WIDGET-SPECIFIC OPTIONS".VS.OP \-postcommand postCommand CommandIf this option is specified then it provides a Tcl command to executeeach time the menu is posted.  The command is invoked by the \fBpost\fRwidget command before posting the menu. Note that in 8.0 on Macintoshand Windows, all commands in a menu systems are executed before anyare posted. This is due to the limitations in the individual platforms'menu managers..VE.OP \-selectcolor selectColor BackgroundFor menu entries that are check buttons or radio buttons, this optionspecifies the color to display in the indicator when the check buttonor radio button is selected..OP \-tearoff tearOff TearOffThis option must have a proper boolean value, which specifieswhether or not the menu should include a tear-off entry at thetop.  If so, it will exist as entry 0 of the menu and the otherentries will number starting at 1.  The defaultmenu bindings arrange for the menu to be torn off when the tear-offentry is invoked..OP \-tearoffcommand tearOffCommand TearOffCommandIf this option has a non-empty value, then it specifies a Tcl commandto invoke whenever the menu is torn off.  The actual command willconsist of the value of this option, followed by a space, followedby the name of the menu window, followed by a space, followed bythe name of the name of the torn off menu window.  For example, ifthe option's is ``\fBa b\fR'' and menu \fB.x.y\fR is torn off tocreate a new menu \fB.x.tearoff1\fR, then the command``\fBa b .x.y .x.tearoff1\fR'' will be invoked..VS.OP \-title title TitleThe string will be used to title the window created when this menu istorn off. If the title is NULL, then the window will have the titleof the menubutton or the text of the cascade item from which this menuwas invoked..OP \-type type TypeThis option can be one of \fBmenubar\fR, \fBtearoff\fR, or\fBnormal\fR, and is set when the menu is created. While the stringreturned by the configuration database will change if this option ischanged, this does not affect the menu widget's behavior. This is usedby the cloning mechanism and is not normally set outside of the Tklibrary..VE.BE.SH INTRODUCTION.PPThe \fBmenu\fR command creates a new top-level window (givenby the \fIpathName\fR argument) and makes it into a menu widget.Additionaloptions, described above, may be specified on the command lineor in the option databaseto configure aspects of the menu such as its colors and font.The \fBmenu\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..PP.VSA menu is a widget that displays a collection of one-line entries arrangedin one or more columns.  There exist several different types of entries,each with different properties.  Entries of different types may becombined in a single menu.  Menu entries are not the same asentry widgets.  In fact, menu entries are not even distinct widgets;the entire menu is one widget..VE.PPMenu entries are displayed with up to three separate fields.The main field is a label in the form of a text string,a bitmap, or an image, controlled by the \fB\-label\fR,\fB\-bitmap\fR, and \fB\-image\fR options for the entry.If the  \fB\-accelerator\fR option is specified for an entry then a secondtextual field is displayed to the right of the label.  The acceleratortypically describes a keystroke sequence that may be typed in theapplication to cause the same result as invoking the menu entry.The third field is an \fIindicator\fR.  The indicator is present only forcheckbutton or radiobutton entries.  It indicates whether the entryis selected or not, and is displayed to the left of the entry'sstring..PPIn normal use, an entry becomes active (displays itself differently)whenever the mouse pointer is over the entry.  If a mousebutton is released over the entry then the entry is \fIinvoked\fR.The effect of invocation is different for each type of entry;these effects are described below in the sections on individualentries..PPEntries may be \fIdisabled\fR, which causes their labelsand accelerators to be displayedwith dimmer colors.The default menu bindings will not allowa disabled entry to be activated or invoked.Disabled entries may be re-enabled, at which point it becomespossible to activate and invoke them again..VS.PPWhenever a menu's active entry is changed, a <<MenuSelect>> virtualevent is send to the menu. The active item can then be queried fromthe menu, and an action can be taken, such as settingcontext-sensitive help text for the entry..VE.SH "COMMAND ENTRIES".PPThe most common kind of menu entry is a command entry, whichbehaves much like a button widget.  When a command entry isinvoked, a Tcl command is executed.  The Tclcommand is specified with the \fB\-command\fR option..SH "SEPARATOR ENTRIES".PPA separator is an entry that is displayed as a horizontal dividingline.  A separator may not be activated or invoked, and it hasno behavior other than its display appearance..SH "CHECKBUTTON ENTRIES".PPA checkbutton menu entry behaves much like a checkbutton widget.When it is invoked it toggles back and forth between the selectedand deselected states.  When the entry is selected, a particularvalue is stored in a particular global variable (as determined bythe \fB\-onvalue\fR and \fB\-variable\fR options for the entry);  whenthe entry is deselected another value (determined by the\fB\-offvalue\fR option) is stored in the global variable.An indicator box is displayed to the left of the label in a checkbuttonentry.  If the entry is selected then the indicator's center is displayedin the color given by the \fB-selectcolor\fR option for the entry;otherwise the indicator's center is displayed in the background color forthe menu.  If a \fB\-command\fR option is specified for a checkbuttonentry, then its value is evaluated as a Tcl command each time the entryis invoked;  this happens after toggling the entry'sselected state..SH "RADIOBUTTON ENTRIES".PPA radiobutton menu entry behaves much like a radiobutton widget.Radiobutton entries are organized in groups of which only oneentry may be selected at a time.  Whenever a particular entrybecomes selected it stores a particular value into a particularglobal variable (as determined by the \fB\-value\fR and\fB\-variable\fR options for the entry).  This actioncauses any previously-selected entry in the same groupto deselect itself.Once an entry has become selected, any change to the entry'sassociated variable will cause the entry to deselect itself.Grouping of radiobutton entries is determined by theirassociated variables:  if two entries have the same associatedvariable then they are in the same group.An indicator diamond is displayed to the left of the label in eachradiobutton entry.  If the entry is selected then the indicator'scenter is displayed in the color given by the \fB\-selectcolor\fR optionfor the entry;otherwise the indicator's center is displayed in the background color forthe menu.  If a \fB\-command\fR option is specified for a radiobuttonentry, then its value is evaluated as a Tcl command each time the entryis invoked;  this happens after selecting the entry..SH "CASCADE ENTRIES".PPA cascade entry is one with an associated menu (determinedby the \fB\-menu\fR option).  Cascade entries allow the constructionof cascading menus.The \fBpostcascade\fR widget command can be used to post and unpostthe associated menu just next to of the cascade entry.The associated menu must be a child of the menu containingthe cascade entry (this is needed in order for menu traversal towork correctly)..PPA cascade entry posts its associated menu by invoking aTcl command of the form.CS\fImenu\fB post \fIx y\fR.CEwhere \fImenu\fR is the path name of the associated menu, and \fIx\fRand \fIy\fR are the root-window coordinates of the upper-rightcorner of the cascade entry..VSOn Unix, the lower-level menu is unposted by executing a Tcl command withthe form.CS\fImenu\fB unpost\fR.CEwhere \fImenu\fR is the name of the associated menu.On other platforms, the platform's native code takes care of unposting themenu..VE.PP.VSIf a \fB\-command\fR option is specified for a cascade entry then it isevaluated as a Tcl command whenever the entry is invoked. This is notsupported on Windows..VE.SH "TEAR-OFF ENTRIES".PPA tear-off entry appears at the top of the menu if enabled with the\fBtearOff\fR option.  It is not like other menu entries in thatit cannot be created with the \fBadd\fR widget command andcannot be deleted with the \fBdelete\fR widget command.When a tear-off entry is created it appears as a dashed line atthe top of the menu.  Under the default bindings, invoking thetear-off entry causes a torn-off copy to be made of the menu andall of its submenus..VS.SH "MENUBARS".PPAny menu can be set as a menubar for a toplevel window (see\fBtoplevel\fR command for syntax). On the Macintosh, whenever thetoplevel is in front, this menu's cascade items will appear in themenubar across the top of the main monitor. On Windows and Unix, thismenu's items will be displayed in a menubar accross the top of thewindow. These menus will behave according to the interface guidelinesof their platforms. For every menu set as a menubar, a clone menu ismade. See the \fBCLONES\fR section for more information..VE.VS.SH "SPECIAL MENUS IN MENUBARS".PPCertain menus in a menubar will be treated specially.  On the Macintosh,access to the special Apple and Help menus is provided. On Windows,access to the Windows System menu in each window is provided. On X Windows,a special right-justified help menu is provided. In all cases, thesemenus must be created with the command name of the menubar menu concatenatedwith the special name. So for a menubar named .menubar, on the Macintosh,the special menus would be .menubar.apple and .menubar.help; on Windows,the special menu would be .menubar.system; on X Windows, the helpmenu would be .menubar.help..PP

⌨️ 快捷键说明

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