当前位置:网站首页>Gui Gui programming (XV) - use scale to control font size changes
Gui Gui programming (XV) - use scale to control font size changes
2022-07-01 07:41:00 【Progress Xiaobai】
Thank you for opening Xiaobai's article
“ I hope you have made a little progress today , One step closer to a better life !”
Scale Move the slider
Scale( Move the slider ) Used in the specified value range , Move the slider to Select value .
Scale Widgets are used to implement python Application's graphical slider , So that the user can slide the value range displayed on the slider and select one of them . We can control the resolution of the minimum and maximum values as well as the scale . When the user is forced to select only one value from a given range of values , It provides Entry Alternatives to widgets .
Use
| SN | Options | explain |
| 1 | activebackground | The background color of the widget when it has focus . |
| 2 | bg | The background color of the widget . |
| 3 | bd | The border size of the widget . The default value is 2 Pixels . |
| 4 | command | Set the steps to call each time you move the slider . If the slider moves quickly , The callback is completed at the end . |
| 5 | cursor | The mouse pointer changes to the cursor type assigned to this option . It can be an arrow , Point etc . |
| 6 | digits | If the control variable used to control the proportional data is a string type , This option is used to specify the number of digits when converting the numeric scale to a string . |
| 7 | font | Font type of widget text . |
| 8 | fg | The foreground color of the text . |
| 9 | from_ | It is used to represent one end of the widget scope . |
| 10 | highlightbackground | Highlight color when the widget has no focus . |
| 11 | highlighcolor | Highlight color when widget has focus . |
| 12 | label | Can be set to some text , Can be displayed as a label with a ruler . If the scale is horizontal , Is displayed in the upper left corner ; If the scale is vertical , Is displayed in the upper right corner . |
| 13 | length | It represents the length of the widget . If the scale is horizontal , said X dimension ; If the scale is vertical , said y dimension . |
| 14 | orient | It can be set to horizontal or vertical according to the type of scale . |
| 15 | relief | It represents the type of boundary . The default value is FLAT. |
| 16 | repeatdelay | This option indicates the duration of pressing the button before the slider repeatedly starts moving in this direction . The default value is 300 millisecond . |
| 17 | resolution | Set to the minimum change in the scale value . |
| 18 | showvalue | By default , The scaled value is displayed in text . We can set this option to 0 With a prohibition label . |
| 19 | sliderlength | It represents the length of the slider window along the scale length . The default value is 30 Pixels . however , We can change it to an appropriate value . |
| 20 | state | By default ,scale Widget is active . We can set it to DISABLED To make it unresponsive . |
| 21 | takefocus | By default , The focus will cycle through the zoom widget . If we don't want this to happen , We can set this option to 0. |
| 22 | tickinterval | Proportional values are displayed in multiples of the specified tick interval . tickinterval The default value is 0. |
| 23 | to | It represents a floating-point or integer value , It specifies the other end of the range represented by the scale . |
| 24 | troughcolor | It represents the color of the passage . |
| 25 | variable | It represents the proportional control variable . |
| 26 | width | It represents the width of the penetration of the widget . |
Method
| SN | Method | explain |
| 1 | get() | It is used to get the current value of the scale . |
| 2 | set(value) | The value used to set the scale . |
Use Scale( Move the slider ) Control font size changes
from tkinter import *
root = Tk();root.geometry("400x150")
def test1(value):
print(" The value of the slider :",value)
newFont = (" Song style ",value)
a.config(font=newFont)
s1 = Scale(root,from_=10,to=50,length=200,tickinterval=5,orient=HORIZONTAL,command=test1)
s1.pack()
a = Label(root,text=" Progress Xiaobai ",width=10,height=1,bg="red",fg="white")
a.pack()
root.mainloop()
result :

边栏推荐
- The programmer of Beipiao posted a post for help late at night: I am lonely when my girlfriend is gone
- 【mysql学习笔记26】视图
- Cadence OrCAD capture "network name" is the same, but it is not connected or connected incorrectly. The usage of nodeName of liberation scheme
- 华为ModelArts训练Alexnet模型
- Challenges faced by operation and maintenance? Intelligent operation and maintenance management system to help you
- Mysql与Redis一致性解决方案
- H5 页面设置了字体的粗细样式,但是在华为手机里微信打开访问样式不生效?
- Do securities account opening affect the security of account opening
- 2022 test questions and mock examinations for main principals of hazardous chemicals business units
- Kdtree notes
猜你喜欢

【编程强训2】排序子序列+倒置字符串

奥迪AUDI EDI 项目中供应商需要了解哪些信息?

ONES 创始人王颖奇对话《财富》(中文版):中国有没有优秀的软件?

C# Newtonsoft.Json中JObject的使用

What information does the supplier need to know about Audi EDI project?

The triode is a great invention

Software testing methods and techniques - overview of basic knowledge
![[recommendation system] breakthrough and imagination of deep location interactive network dpin for meituan takeout recommendation scenario](/img/10/ed857892d2e0ea72e100a4008e6d69.png)
[recommendation system] breakthrough and imagination of deep location interactive network dpin for meituan takeout recommendation scenario

Warm congratulations on the successful listing of five elements hehe liquor

浏览器本地存储
随机推荐
Microsoft announces open source (Godel) language model chat robot
C# Newtonsoft. Use of job in JSON
Custom events of components ①
TCP/UDP 通信问题整理
[programming training 2] sorting subsequence + inverted string
长路漫漫、技术作伴
2022 operation of refrigeration and air conditioning equipment operation of national question bank simulated examination platform
Eigen matrix operation Library
redisson使用全解——redisson官方文檔+注釋(上篇)
Is it safe to buy funds on the brokerage account
[programming training] delete public characters (hash mapping) + team competition (greedy)
Solution to the problem that objects in unity2021 scene view cannot be directly selected
The programmer of Beipiao posted a post for help late at night: I am lonely when my girlfriend is gone
Summary of the concept and advantages of 5g massive MIMO
【微服务|openfeign】Feign的日志记录
C# 读写自定义的Config文件
Is it safe and reliable for Huatai Securities to open an account? How to open Huatai Securities Account
Stepsister becomes stepmother, son breaks off relationship with himself, and musk, the world's richest man, why is it so miserable?
base64
[MySQL learning notes 25] SQL statement optimization