官术网_书友最值得收藏!

How it works...

Both classes accept the from_ and to options to indicate the range of valid values—the trailing underscore is necessary because the from option was originally defined in Tcl/Tk, but it is a reserved keyword in Python.

A handy functionality of the Scale class is the resolution option, which sets the precision of the rounding. For instance, a resolution of 0.2 will allow the user to select the values 0.0, 0.2, 0.4, and so on. The value of this option is 1 by default, so the widget rounds all values to the nearest integer.

As usual, the value of each widget can be retrieved with the get() method. An important difference is that Spinbox returns the number as a string, whereas Scale returns an integer value or a float value if the rounding accepts decimal values.

主站蜘蛛池模板: 且末县| 东台市| 五原县| 邢台县| 北安市| 奈曼旗| 东乌珠穆沁旗| 固镇县| 通化县| 宁夏| 平江县| 阳东县| 法库县| 宜君县| 隆安县| 内黄县| 正蓝旗| 思茅市| 临泉县| 澄江县| 江阴市| 灵武市| 剑阁县| 蒙城县| 亚东县| 沛县| 陆良县| 韶山市| 英吉沙县| 凌海市| 启东市| 昭平县| 固安县| 新干县| 临海市| 鄢陵县| 循化| 伊金霍洛旗| 榆树市| 宁津县| 都昌县|