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

📄 checkbutton.n

📁 linux系统下的音频通信
💻 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: @(#) checkbutton.n 1.40 96/11/20 12:51:21'\" .so man.macros.TH checkbutton n 4.4 Tk "Tk Built-In Commands".BS'\" Note:  do not modify the .SH NAME line immediately below!.SH NAMEcheckbutton \- Create and manipulate checkbutton widgets.SH SYNOPSIS\fBcheckbutton\fI pathName \fR?\fIoptions\fR?.SO\-activebackground	\-cursor	\-highlightthickness	\-takefocus\-activeforeground	\-disabledforeground	\-image	\-text\-anchor	\-font	\-justify	\-textvariable\-background	\-foreground	\-padx	\-underline\-bitmap	\-highlightbackground	\-pady	\-wraplength\-borderwidth	\-highlightcolor	\-relief.SE.SH "WIDGET-SPECIFIC OPTIONS".OP \-command command CommandSpecifies a Tcl command to associate with the button.  This commandis typically invoked when mouse button 1 is released over the buttonwindow.  The button's global variable (\fB\-variable\fR option) willbe updated before the command is invoked..OP \-height height HeightSpecifies a desired height for the button.If an image or bitmap is being displayed in the button then the value is inscreen units (i.e. any of the forms acceptable to \fBTk_GetPixels\fR);for text it is in lines of text.If this option isn't specified, the button's desired height is computedfrom the size of the image or bitmap or text being displayed in it..OP \-indicatoron indicatorOn IndicatorOnSpecifies whether or not the indicator should be drawn.  Must be aproper boolean value.  If false, the \fBrelief\fR option isignored and the widget's relief is always sunken if the widget isselected and raised otherwise..OP \-offvalue offValue ValueSpecifies value to store in the button's associated variable wheneverthis button is deselected.  Defaults to ``0''..OP \-onvalue onValue ValueSpecifies value to store in the button's associated variable wheneverthis button is selected.  Defaults to ``1''..OP \-selectcolor selectColor BackgroundSpecifies a background color to use when the button is selected.If \fBindicatorOn\fR is true then the color applies to the indicator.Under Windows, this color is used as the background for the indicatorregardless of the select state.If \fBindicatorOn\fR is false, this color is used as the backgroundfor the entire widget, in place of \fBbackground\fR or \fBactiveBackground\fR,whenever the widget is selected.If specified as an empty string then no special color is used fordisplaying when the widget is selected..OP \-selectimage selectImage SelectImageSpecifies an image to display (in place of the \fBimage\fR option)when the checkbutton is selected.This option is ignored unless the \fBimage\fR option has beenspecified..OP \-state state StateSpecifies one of three states for the checkbutton:  \fBnormal\fR, \fBactive\fR,or \fBdisabled\fR.  In normal state the checkbutton is displayed using the\fBforeground\fR and \fBbackground\fR options.  The active state istypically used when the pointer is over the checkbutton.  In active statethe checkbutton is displayed using the \fBactiveForeground\fR and\fBactiveBackground\fR options.  Disabled state means that the checkbuttonshould be insensitive:  the default bindings will refuse to activatethe widget and will ignore mouse button presses.In this state the \fBdisabledForeground\fR and\fBbackground\fR options determine how the checkbutton is displayed..OP \-variable variable VariableSpecifies name of global variable to set to indicate whetheror not this button is selected.  Defaults to the name of thebutton within its parent (i.e. the last element of the buttonwindow's path name)..OP \-width width WidthSpecifies a desired width for the button.If an image or bitmap is being displayed in the button then the value is inscreen units (i.e. any of the forms acceptable to \fBTk_GetPixels\fR);for text it is in characters.If this option isn't specified, the button's desired width is computedfrom the size of the image or bitmap or text being displayed in it..BE.SH DESCRIPTION.PPThe \fBcheckbutton\fR command creates a new window (given by the\fIpathName\fR argument) and makes it into a checkbutton widget.Additionaloptions, described above, may be specified on the command lineor in the option databaseto configure aspects of the checkbutton such as its colors, font,text, and initial relief.  The \fBcheckbutton\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..PPA checkbutton is a widgetthat displays a textual string, bitmap or imageand a square called an \fIindicator\fR.If text is displayed, it must all be in a single font, but itcan occupy multiple lines on the screen (if it contains newlinesor if wrapping occurs because of the \fBwrapLength\fR option) andone of the characters may optionally be underlined using the\fBunderline\fR option.A checkbutton hasall of the behavior of a simple button, including thefollowing: it can display itself in either of three differentways, according to the \fBstate\fR option;it can be made to appearraised, sunken, or flat; it can be made to flash; and it invokesa Tcl command whenever mouse button 1 is clicked over thecheckbutton..PPIn addition, checkbuttons can be \fIselected\fR.If a checkbutton is selected then the indicator is normally.VSdrawn with a selected appearance, anda Tcl variable associated with the checkbutton is set to a particularvalue (normally 1).Under Unix, the indicator is drawn with a sunken relief and a specialcolor.  Under Windows, the indicator is drawn with a check mark inside.If the checkbutton is not selected, then the indicator is drawn with adeselected appearance, and the associated variable isset to a different value (typically 0).Under Unix, the indicator is drawn with a raised relief and no specialcolor.  Under Windows, the indicator is drawn without a check mark inside..VEBy default, the name of the variable associated with a checkbutton is thesame as the \fIname\fR used to create the checkbutton.The variable name, and the ``on'' and ``off'' values stored in it,may be modified with options on the command line or in the optiondatabase.Configuration options may also be used to modify the way theindicator is displayed (or whether it is displayed at all).By default a checkbutton is configured to select and deselectitself on alternate button clicks.In addition, each checkbutton monitors its associated variable andautomatically selects and deselects itself when the variables valuechanges to and from the button's ``on'' value..SH "WIDGET COMMAND".PPThe \fBcheckbutton\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.  The followingcommands are possible for checkbutton widgets:.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 \fBcheckbutton\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 \fBcheckbutton\fRcommand..TP\fIpathName \fBdeselect\fRDeselects the checkbutton and sets the associated variable to its ``off''value..TP\fIpathName \fBflash\fRFlashes the checkbutton.  This is accomplished by redisplaying the checkbuttonseveral times, alternating between active and normal colors.  Atthe end of the flash the checkbutton is left in the same normal/activestate as when the command was invoked.This command is ignored if the checkbutton's state is \fBdisabled\fR..TP\fIpathName \fBinvoke\fRDoes just what would have happened if the user invoked the checkbuttonwith the mouse: toggle the selection state of the button and invokethe Tcl command associated with the checkbutton, if there is one.The return value is the return value from the Tcl command, or anempty string if there is no command associated with the checkbutton.This command is ignored if the checkbutton's state is \fBdisabled\fR..TP\fIpathName \fBselect\fRSelects the checkbutton and sets the associated variable to its ``on''value..TP\fIpathName \fBtoggle\fRToggles the selection state of the button, redisplaying it andmodifying its associated variable to reflect the new state..SH BINDINGS.PPTk automatically creates class bindings for checkbuttons that give themthe following default behavior:.VS.IP [1]On Unix systems, a checkbutton activates whenever the mouse passesover it and deactivates whenever the mouse leaves the checkbutton.  OnMac and Windows systems, when mouse button 1 is pressed over acheckbutton, the button activates whenever the mouse pointer is insidethe button, and deactivates whenever the mouse pointer leaves thebutton..VE.IP [2]When mouse button 1 is pressed over a checkbutton, it is invoked (itsselection state toggles and the command associated with the button isinvoked, if there is one)..VS.IP [3]When a checkbutton has the input focus, the space key causes the checkbuttonto be invoked.  Under Windows, there are additional key bindings; plus(+) and equal (=) select the button, and minus (-) deselects the button..VE.PPIf the checkbutton's state is \fBdisabled\fR then none of the aboveactions occur:  the checkbutton is completely non-responsive..PPThe behavior of checkbuttons can be changed by defining new bindings forindividual widgets or by redefining the class bindings..SH KEYWORDScheckbutton, widget

⌨️ 快捷键说明

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