Next / Previous / Contents / TCC Help System / NM Tech homepage

12.1. Menu item creation (coption) options

These are the possible values of the coption choice options used in the methods above:

activebackgroundThe background color used for choices when they are under the mouse.
activeforegroundThe foreground color used for choices when they are under the mouse.
backgroundThe background color used for choices when they are not under the mouse. Note that this cannot be abbreviated as bg.
bitmapDisplay a bitmap for this choice; see Section 4.7, “Bitmaps”.
columnbreakNormally all the choices are displayed in one long column. If you set columnbreak=1, this choice will start a new column to the right of the one containing the previous choice.
commandA procedure to be called when this choice is activated.
fontThe font used to render the label text. See Section 4.4, “Type fonts”
foregroundThe foreground color used for choices when they are not under the mouse. Note that this cannot be abbreviated as fg.
imageDisplay an image for this choice; see Section 4.9, “Images”.
labelThe text string to appear for this choice.
menuThis option is used only for cascade choices. Set it to a Menu object that displays the next level of choices.
offvalueNormally, the control variable for a checkbutton is set to 0 when the checkbutton is off. You can change the off value by setting this option to the desired value. See Section 22, “Control variables: the values behind the widgets”.
onvalueNormally, the control variable for a checkbutton is set to 1 when the checkbutton is on. You can change the on value by setting this option to the desired value.
selectcolorNormally, the color displayed in a set checkbutton or radiobutton is red. Change that color by setting this option to the color you want; see Section 4.3, “Colors”.
stateNormally, all choices react to mouse clicks, but you can set state=DISABLED to gray it out and make it unresponsive.
underlineNormally none of the letters in the label are underlined. Set this option to the index of a letter to underline that letter.
valueSpecifies the value of the associated control variable (see Section 22, “Control variables: the values behind the widgets”) for a radiobutton. This can be an integer if the control variable is an IntVar, or a string if the control variable is a StringVar.
variableFor checkbuttons or radiobuttons, this option should be set to the control variable associated with the checkbutton or group of radiobuttons. See Section 22, “Control variables: the values behind the widgets”.