12.07.2015 Views

Tkinter reference: A GUI for Python

Tkinter reference: A GUI for Python

Tkinter reference: A GUI for Python

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Each radiobutton in a group must have a unique value option of the same typeas the control variable. For example, a group of three radiobuttons might share anIntVar and have values of 0, 1, and 99. Or you can use a StringVar control variableand give the radiobuttons value options like "too hot", "too cold", and "justright".To create a new radiobutton widget as the child of a root window or frame named master:w = Radiobutton ( master, *options )This constructor returns the new radiobutton widget. Options:activebackground The background color when the mouse is over theradiobutton.active<strong>for</strong>eground The <strong>for</strong>eground color when the mouse is over theradiobutton.anchorIf the widget inhabits a space larger than it needs,this option specifies where the radiobutton will sitin that space. The default is CENTER, but you canspecify any of N, NE, E, SE, S, SW, W, or NW.backgroundThe normal background color. May be abbreviatedbg.bitmapTo display a monochrome image on a radiobutton,set this option to a bitmap; see Bitmaps, above.borderwidthThe size of the border around the indicator partitself. Default is 2 pixels.commandA procedure to be called every time the userchanges the state of this radiobutton.cursorIf you set this option to a cursor name (see Cursors,above), the mouse cursor will change to that patternwhen it is over the radiobutton.disabled<strong>for</strong>eground The <strong>for</strong>eground color used to render the text of adisabled radiobutton. The default is a stippled versionof the default <strong>for</strong>eground color.fontThe font used <strong>for</strong> the text.<strong>for</strong>egroundThe color used to render the text. Can be abbreviatedfg.heightThe number of lines of text on the radiobutton. Defaultis 1.highlightbackground The color of the focus highlight when the radiobuttondoes not have focus. See Focus, below.highlightcolor The color of the focus highlight when the radiobuttonhas the focus. See Focus, below.highlightthickness The thickness of the focus highlight. Default is 1.Set to 0 to suppress display of the focus highlight.See Focus, below.imageTo display a graphic image instead of text <strong>for</strong> thisradiobutton, set this option to an image object. SeeImages, above. The image appears when the radiobuttonis not selected; compare selectimage,below.New Mexico Tech Computer Center <strong>Tkinter</strong> <strong>reference</strong>: The Radiobutton widget Page 41

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!