问题标签 [tkinter-scale]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
123 浏览

python - 比例小部件不显示

这是我的代码,比例尺不显示。有什么建议吗?

0 投票
1 回答
953 浏览

python - 如何在 Python 中设置 tkinter Scale 小部件的初始值?

我想将Scale小部件的值初始化为2. 我怎样才能做到这一点?因为我使用了网格,.set所以无法正常工作。

这是我的代码:

0 投票
1 回答
356 浏览

python - How control the value of a tkinter `Scale` widget depending on the value of another tkinter `Scale` widget in Python?

I have 3 Scale widgets scale1, scale2 and scale3. I would like to use scale1 to control the values of scale2 and scale3 in the following manner:

  • I don't want scale2 and scale3 having the same value as scale1.
  • If value of scale1 is 1, value of scale2 is 2.5 and value of scale3 is 1.5
  • When I move scale1 to the right to increase its value to 1.05, the value of scale2 will be 2.55 and scale3 will be 1.55
  • Or I move scale1 to the left to decrease its value to 0.95, then scale2 value will be 2.45 and scale3 value will be 1.45

Here is my code:

#xA;
0 投票
0 回答
40 浏览

python - 可变分辨率缩放

我正在使用 Python 的tkinter包开发一个绘画应用程序。

我正在制作一个 Scale 小部件来处理缩放。我希望用户能够缩放0.5x, 1x, 2x, and 4x。问题是,决议正在改变。

从 0.5 到 1,分辨率为 0.5。

从 1 到 2,分辨率为 1。

从 2 到 4,分辨率为 2。

是否可以声明具有不同分辨率的 Scale 小部件?

0 投票
1 回答
3117 浏览

python - 如何使用来自另一个 Scale 小部件的值更新 Scale 小部件

我正在尝试Scale动态更新小部件的值,以便将其值更改为另一个Scale小部件的值。只是为了了解该Scale.set()方法的工作原理,我尝试了以下方法:

但是当我尝试运行时,我得到了:

当我将command关键字参数传递给按钮时,它工作正常。这里有什么问题?我认为这都是关于Scale小部件及其方法的。我对他们不太满意,任何帮助将不胜感激。

0 投票
1 回答
1357 浏览

python - 如何将 tkinter Scale 小部件的状态设置为禁用?

我一直在寻找一种禁用Scaletkinter 小部件的方法,但我找不到。

我尝试了一些东西,但似乎没有一个工作:

有谁知道它是否可能或是否有解决方法?我设法让它在ButtonCheckbutton小部件上正常工作。

0 投票
0 回答
534 浏览

python - Python Tkinter 缩放小部件但没有覆盖整个窗口高度,为什么?

我正在做一项任务,但需要您在 tkinter 中提供建议定位比例,我没有任何成功,尝试了多种选择,也许您可​​以给我一个想法:

比例应该覆盖我的窗口的整个长度,但只会居中为什么?,我需要在不久的将来添加更多比例而不改变屏幕尺寸。

谢谢

0 投票
2 回答
5801 浏览

python - 如何在 Python 中检索 tkinter ttk Scale 小部件的整数值?

谁能建议如何使用Python 中小Label部件的值检索和更新小部件?Scale目前它显示了一个非常大的实数。我尝试输入强制转换值,但这仅在我打印到空闲时才有效。我试过slider.get()了,但标签是空白的。还尝试int(slider.get())了当我打印到空闲时哪个有效。

在这里您可以看到非常大的实际值:

截屏

0 投票
1 回答
396 浏览

python - 如何对 tkinter Scale 小部件的某些值执行操作?

我正在使用 Python 中的 Tkinter,但我对Scale小部件有疑问。我想做的是对Scale的某些值采取行动。

这是Scale代码的一部分:

发生了一些奇怪的事情,当我运行脚本时,比例值为 0,但条件似乎为真并打印“值为 10”。此外,当我更改刻度的值时,即使值大于 10,它也不会匹配条件。

0 投票
0 回答
484 浏览

tkinter - 如何在 Raspberry Pi Python 中将多进程与 Tkinter 一起使用

我正在尝试同时移动两个伺服系统。但是我动不了。因为第二个电机在完成我在 tkinter 规模上命令的第一个电机运动后移动。我已经从多进程导入 Process 并尝试过。当我将 scale 命令从 更改command=self.update为 时,command=Process(target=update, args()).start它给了我NameError: name 'update' is not defined

我不知道我应该怎么做,所以任何帮助都将不胜感激。

我的工作(非同时)代码如下。