添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
想出家的墨镜  ·  以 4k (3840*2160) ...·  2 天前    · 
爱跑步的柳树  ·  python tkinter ...·  2 天前    · 
心软的松鼠  ·  從 Power Apps 連線 ...·  5 天前    · 
不要命的帽子  ·  flutter ...·  7 月前    · 
独立的帽子  ·  sqlite3.operationalerr ...·  1 年前    · 
# 获取屏幕分辨率 screenWidth = window.winfo_screenwidth() screenHeight = window.winfo_screenheight() x = int((screenWidth - winWidth) / 2) y = int((screenHeight - winHeight) / 2) # 设置主窗口标题 window.title("Scale参数说明") # 设置窗口初始位置在屏幕居中 window.geometry("%sx%s+%s+%s" % (winWidth, winHeight, x, y)) # 设置窗口图标 window.iconbitmap("./image/icon.ico") # 设置窗口宽高固定 window.resizable(0, 0) """scale参数. Valid resource names: activebackground, background, bigincrement, bd, bg, borderwidth, command, cursor, digits, fg, font, foreground, from, highlightbackground, highlightcolor, highlightthickness, label, length, orient, relief, repeatdelay, repeatinterval, resolution, showvalue, sliderlength, sliderrelief, state, takefocus, tickinterval, to, troughcolor, variable, width.""" def select(v): print(v) # 创建一个1到100的滑块, 精度为0.01, 显示的最大位数为8 scale = tk.Scale(window, label="滑块", length = 400, from_=1, to = 100, bg="#bbb", fg = "#f00", orient = tk.HORIZONTAL, command=select, resolution=0.01, digits = 8) scale.pack() def getScaleValue(): print(scale.get()) def setScaleValue(): scale.set(10) tk.Button(window, text="get value", width=30, pady=5, command=getScaleValue).pack() tk.Button(window, text="set value", width=30, pady=5, command=setScaleValue).pack() window.mainloop()

三、效果图