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

📄 menu.n

📁 linux系统下的音频通信
💻 N
📖 第 1 页 / 共 3 页
字号:
When Tk sees an Apple menu on the Macintosh, that menu's contents makeup the first items of the Apple menu on the screen whenever the windowcontaining the menubar is in front. The menu is thefirst one that the user sees and has a title which is an Apple logo.After all of the Tk-defined items, the menu will have a separator,followed by all of the items in the user's Apple Menu Items folder.Since the System uses a different menu definition procedure forthe Apple menu than Tk uses for its menus, and the system APIs donot fully support everything Tk tries to do, the menu item will onlyhave its text displayed. No font attributes, images, bitmaps, or colorswill be displayed. In addition, a menu with a tearoff item will havethe tearoff item displayed as "(TearOff)"..PPWhen Tk see a Help menu on the Macintosh, the menu's contents areappended to the standard help menu on the right of the user's menubarwhenever the user's menubar is in front. The first items in the menuare provided by Apple. Similar to the Apple Menu, cusomization in thismenu is limited to what the system provides..PPWhen Tk sees a System menu on Windows, its items are appended to the system menu that the menubar is attached to. This menu has an iconrepresenting a spacebar, and can be invoked with the mouse or by typingAlt+Spacebar.  Due to limitations in the Windows API, any font changes,colors, images, bitmaps, or tearoff images will not appear in thesystem menu..PPWhen Tk see a Help menu on X Windows, the menu is moved to be last inthe menubar and is right justified..VE.VS.SH "CLONES".PPWhen a menu is set as a menubar for a toplevel window, or when a menuis torn off, a clone of the menu is made. This clone is a menu widgetin its own right, but it is a child of the original. Changes in theconfiguration of the original are reflected in theclone. Additionally, any cascades that are pointed to are also clonedso that menu traversal will work right. Clones are destroyed wheneither the tearoff or menubar goes away, or when the original menu isdestroyed. .VE.SH "WIDGET COMMAND".PPThe \fBmenu\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 a menu take as one argument anindicator of which entry of the 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 menu, 1 to the entry below it, andso on..TP 12\fBactive\fRIndicates the entry that is currently active.  If no entry isactive then this form is equivalent to \fBnone\fR.  This form maynot be abbreviated..TP 12\fBend\fRIndicates the bottommost entry in the menu.  If there are noentries in the menu then this form is equivalent to \fBnone\fR.This form may not be abbreviated..TP 12\fBlast\fRSame as \fBend\fR..TP 12\fBnone\fRIndicates ``no entry at all'';  this is used most commonly withthe \fBactivate\fR option to deactivate all the entries in themenu.  In most cases the specification of \fBnone\fR causesnothing to happen in the widget command.This form may not be abbreviated..TP 12\fB@\fInumber\fRIn this form, \fInumber\fR is treated as a y-coordinate in themenu's window;  the entry closest to that y-coordinate is used.For example, ``\fB@0\fR'' indicates the top-most entry in thewindow..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 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 menu widgets:.TP\fIpathName \fBactivate \fIindex\fRChange the state of the entry indicated by \fIindex\fR to \fBactive\fRand redisplay it using its active colors.Any previously-active entry is deactivated.  If \fIindex\fRis specified as \fBnone\fR, or if the specified entry isdisabled, then the menu ends up with no active entry.Returns an empty string..TP\fIpathName \fBadd \fItype \fR?\fIoption value option value ...\fR?Add a new entry to the bottom of the menu.  The new entry's typeis given by \fItype\fR and must be one of \fBcascade\fR,\fBcheckbutton\fR, \fBcommand\fR, \fBradiobutton\fR, or \fBseparator\fR,or a unique abbreviation of one of the above.  If additional argumentsare present, they specify any of the following options:.RS.TP\fB\-activebackground \fIvalue\fRSpecifies a background color to use for displaying this entry when itis active.If this option is specified as an empty string (the default), then the\fBactiveBackground\fR option for the overall menu is used.If the \fBtk_strictMotif\fR variable has been set to request strictMotif compliance, then this option is ignored and the \fB\-background\fRoption is used in its place.This option is not available for separator or tear-off entries..TP\fB\-activeforeground \fIvalue\fRSpecifies a foreground color to use for displaying this entry when itis active.If this option is specified as an empty string (the default), then the\fBactiveForeground\fR option for the overall menu is used.This option is not available for separator or tear-off entries..TP\fB\-accelerator \fIvalue\fRSpecifies a string to display at the right side of the menu entry.Normally describes an accelerator keystroke sequence that may betyped to invoke the same function as the menu entry.  This optionis not available for separator or tear-off entries..TP\fB\-background \fIvalue\fRSpecifies a background color to use for displaying this entry when itis in the normal state (neither active nor disabled).If this option is specified as an empty string (the default), then the\fBbackground\fR option for the overall menu is used.This option is not available for separator or tear-off entries..TP\fB\-bitmap \fIvalue\fRSpecifies a bitmap to display in the menu instead of a textuallabel, in any of the forms accepted by \fBTk_GetBitmap\fR.This option overrides the \fB\-label\fR option but may be resetto an empty string to enable a textual label to be displayed.If a \fB\-image\fR option has been specified, it overrides\fB\-bitmap\fR.This option is not available for separator or tear-off entries..VS.TP\fB\-columnbreak \fIvalue\fRWhen this option is zero, the appears below the previous entry. Whenthis option is one, the menu appears at the top of a new column in themenu..VE.TP\fB\-command \fIvalue\fRSpecifies a Tcl command to execute when the menu entry is invoked.Not available for separator or tear-off entries..TP\fB\-font \fIvalue\fRSpecifies the font to use when drawing the label or acceleratorstring in this entry.If this option is specified as an empty string (the default) thenthe \fBfont\fR option for the overall menu is used.This option is not available for separator or tear-off entries..TP\fB\-foreground \fIvalue\fRSpecifies a foreground color to use for displaying this entry when itis in the normal state (neither active nor disabled).If this option is specified as an empty string (the default), then the\fBforeground\fR option for the overall menu is used.This option is not available for separator or tear-off entries..VS.TP\fB\-hidemargin \fIvalue\fRSpecifies whether the standard margins should be drawn for this menuentry. This is useful when creating palette with images in them, i.e.,color palettes, pattern palettes, etc. 1 indicates that the margin forthe entry is hidden; 0 means that the margin is used..VE.TP\fB\-image \fIvalue\fRSpecifies an image to display in the menu instead of a text stringor bitmapThe image must have been created by some previous invocation of\fBimage create\fR.This option overrides the \fB\-label\fR and \fB\-bitmap\fR optionsbut may be reset to an empty string to enable a textual orbitmap label to be displayed.This option is not available for separator or tear-off entries..TP\fB\-indicatoron \fIvalue\fRAvailable only for checkbutton and radiobutton entries.\fIValue\fR is a boolean that determines whether or not theindicator should be displayed..TP\fB\-label \fIvalue\fRSpecifies a string to display as an identifying label in the menuentry.  Not available for separator or tear-off entries..TP\fB\-menu \fIvalue\fRAvailable only for cascade entries.  Specifies the path name ofthe submenu associated with this entry.The submenu must be a child of the menu..TP\fB\-offvalue \fIvalue\fRAvailable only for checkbutton entries.  Specifies the value tostore in the entry's associated variable when the entry isdeselected..TP\fB\-onvalue \fIvalue\fRAvailable only for checkbutton entries.  Specifies the value tostore in the entry's associated variable when the entry is selected..TP\fB\-selectcolor \fIvalue\fRAvailable only for checkbutton and radiobutton entries.Specifies the color to display in the indicator when the entry isselected.If the value is an empty string (the default) then the \fBselectColor\fRoption for the menu determines the indicator color..TP\fB\-selectimage \fIvalue\fRAvailable only for checkbutton and radiobutton entries.Specifies an image to display in the entry (in place ofthe \fB\-image\fR option) when it is selected.\fIValue\fR is the name of an image, which must have been createdby some previous invocation of \fBimage create\fR.This option is ignored unless the \fB\-image\fR option hasbeen specified..TP\fB\-state \fIvalue\fRSpecifies one of three states for the entry:  \fBnormal\fR, \fBactive\fR,or \fBdisabled\fR.  In normal state the entry is displayed using the\fBforeground\fR option for the menu and the \fBbackground\fRoption from the entry or the menu.The active state is typically used when the pointer is over the entry.In active state the entry is displayed using the \fBactiveForeground\fRoption for the menu along with the \fBactivebackground\fR option fromthe entry.  Disabled state means that the entryshould be insensitive:  the default bindings will refuse to activateor invoke the entry.In this state the entry is displayed according to the \fBdisabledForeground\fR option for the menu and the\fBbackground\fR option from the entry.This option is not available for separator entries..TP

⌨️ 快捷键说明

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