|
|
Asia ... Documentation ... Downloads ... DSSSL ... EFL/ESL ... HTML tools ... Linux ... Photography ... Python ... SGML ... Tcl/Tk ... TeX ... Tips ... Typography ... Word processing |
Software Lab
Python Stuff
True/False Switch
|
The TrueFalseSwitch classA customized checkbutton widget for Tkinter that displays or outputs a boolean value according to a standardized or user-defined format. Here's how it looks with all options set to their default values.
PurposeThis widget is intended to provide easy manipulation of boolean values, with a textual message indicating its state in addition to the checkbutton. Unlike the standard checkbutton, it takes the keyboard focus by default. The widget may be useful for such purposes as attribute editors where, for example, a large number of name-value pairs may be arrayed in a grid, with names in one column and values in the other. Creating an instance of the classExample:
from Tkinter import *
from tfswitch import TrueFalseSwitch
tf = TrueFalseSwitch(win)
tf.pack()
Options
parent Required
displaystyle Optional
outputstyle Optional
This determines how true and false values are returned
to the application. A value of
"numeric" causes the widget to
return an integer value of 1 or
0. Note that this is different from
"1/0", which will cause the widget
to return a string consisting of
"1" or
"0". Setting this option to
"" will cause the widget to use the
values from
displaystyle.
initval
Optional
Additional options MethodsThe TrueFalseSwitch class provides two public methods, get() and set(). |
|
|
Matt Gushee
Last modified: Mon Dec 20 03:59:12 JST 1999 |