Tkinter Spinbox [英] Tkinter Spinbox

查看:102
本文介绍了Tkinter Spinbox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我需要一个spinbox,它在创建时可以从另一个位置读取一个变量(这是一个整数)并使用该变量作为起始值。我还需要只允许整数通过键盘输入文本字段(并且只有高达999)。最后,每当旋转箱值改变时(通过键盘输入或通过点击箭头)我需要能够验证它是一个整数然后将其值保存到另一个位置。


i试图做这些事但没有成功。目前我有这个(它已被我的主程序切断:

展开 | 选择 | Wrap < span class =codeDivider> | 行号

解决方案

< blockquote>





我需要一个spinbox,它在创建时可以从另一个位置读取一个变量(这是一个整数)并使用它起始值的变量。我还需要只允许整数通过键盘输入文本字段(并且只有高达999)。最后,每当旋转箱值改变时(通过键盘输入或通过点击输入) g箭头)我需要能够验证它是一个整数然后将其值保存到另一个位置。


我试图做这些事情但没有成功。目前我有这个(它已被我的主程序切断:

展开 | 选择 | Wrap < span class =codeDivider> | 行号






我需要一个spinbox,它在创建时可以从另一个位置读取一个变量(这是一个整数)并使用该变量作为起始值。我还需要只允许整数通过键盘输入到文本字段中(并且只有高达999)。最后,每当旋转框值改变时(通过键盘输入或通过单击箭头)我都需要d能够验证它是一个整数然后将其值保存到另一个位置。


我试图做这些事但没有成功。目前我有这个(它已被我的主程序切断:

展开 | 选择 | Wrap < span class =codeDivider> | 行号


非常感谢你:)当我返回true然后它每次都验证,现在我需要的是获取spinbox值以特定值开始,任何想法?


Hi

I need a spinbox which when created can read a variable (which is an integer) from another location and use that variable for the starting value. i also need to only allow integers be input into the text field by keyboard (and only has high as 999). lastly, whenever the spinbox value is changed (either by keyboard input or by clicking on the arrows) i need to be able to verify that it is an integer and then save its value into another location.

i have tried to do these things but without success. currently i have this (it has been cut out of my main program:

Expand|Select|Wrap|Line Numbers

解决方案

Hi

I need a spinbox which when created can read a variable (which is an integer) from another location and use that variable for the starting value. i also need to only allow integers be input into the text field by keyboard (and only has high as 999). lastly, whenever the spinbox value is changed (either by keyboard input or by clicking on the arrows) i need to be able to verify that it is an integer and then save its value into another location.

i have tried to do these things but without success. currently i have this (it has been cut out of my main program:

Expand|Select|Wrap|Line Numbers


Hi

I need a spinbox which when created can read a variable (which is an integer) from another location and use that variable for the starting value. i also need to only allow integers be input into the text field by keyboard (and only has high as 999). lastly, whenever the spinbox value is changed (either by keyboard input or by clicking on the arrows) i need to be able to verify that it is an integer and then save its value into another location.

i have tried to do these things but without success. currently i have this (it has been cut out of my main program:

Expand|Select|Wrap|Line Numbers


thank you so much :) when i return true then it validates every time, now all i need is get the spinbox value to start at a specific value, any ideas?


这篇关于Tkinter Spinbox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆