在Tkinkter上组合事件处理 [英] Combined event handling on Tkinkter

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

问题描述




我正在Tkinter制作一个GUI程序并遇到问题。我想要做的是绘制2个复选框和一个按钮。根据用户输入应该进行下一步骤。我的代码的一部分如下所示: -

Hey

I am making a GUI Program in Tkinter and am running into problems.What I want to do is draw 2 checkboxes and a button. According to the user input next steps should take place. A part of my code has been shown below :-

展开 | 选择 | Wrap | 行号

推荐答案

您只需调用该函数args。您可以在程序中的任何位置访问self。*变量,因此不需要传递它们,但是我不能从这个片段中说出其他内容。还要注意这两行输出之间的差异(为什么它们不同?)。
You just call the function without the args. You can access self.* variable anywhere in the program so passing them is not necessary, but I can''t tell much else from this snippet. Note also the difference between the output of these two lines (why are they different?).
展开 | 选择 | Wrap | 行号


对不起,我遗漏了你想让变量成为类的成员,以便可以在任何地方访问它们。
Sorry, I left out that you want to make the variables members of the class so they can be accessed anywhere.
展开 | 选择 | Wrap | 行号


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


这篇关于在Tkinkter上组合事件处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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