【发布时间】:2017-04-28 19:16:08
【问题描述】:
所以基本上我有一个按钮,我想更改功能。 Button 应该有 fnc HellWorld,如果我点击它 fnc GoodbyeWorld。
我的尝试:
from appJar import gui
app = gui()
app.setGeometry("300x300")
def HelloWorld(none):
print("Hello World!")
app.getButtonWidget("Button").config(command = GoodbyeWorld(none))
def GoodbyeWorld(none):
print("Goodbye World!")
app.getButtonWidget("Button").config(command = HelloWorld(none))
app.addButton("Button", HelloWorld, 1, 1)
app.go()
但如果我像上面那样做,我的输出是:
Hello World!
Goodbye World!
Hello World!
Goodbye World!
Hello World!
Goodbye World!
Hello World!
Goodbye World!
Hello World!
Goodbye World!
....
然后我收到一些错误消息,并以 RecursionError 结尾。
我做错了吗? (可能是..) AppJar 链接:http://appjar.info/
【问题讨论】:
标签: python-3.x tkinter wrapper