You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for taking the time to open an issue report in our repository. For reference, I have formatted your code in the proper Markdown manner.
fromttkwidgetsimportdebugwindowtry:
importTkinterastkimportttkexceptImportError:
importtkinterastkfromtkinterimportttkroot=tk.Tk()
ttk.Button(root, text="Print 111", command="print(111)").pack()
debugwindow.DebugWindow(root)
print(222, "this works, the button does not, all is broken")
root.mainloop()
It appears that you are using the command keyword argument for the creation of the Button in the wrong way. You see, when you pass the command kwarg, the expected value is a callable object. A string, as you have passed it, is not a callable. Instead, you should use a lambda-expression, like so:
from ttkwidgets import debugwindow
try:
import Tkinter as tk
import ttk
except ImportError:
import tkinter as tk
from tkinter import ttk
root = tk.Tk()
ttk.Button( root, text="Print 111", command="print(111)" ).pack()
debugwindow.DebugWindow(root)
print (222 , "this works, the button does not, all is broken" )
root.mainloop()
The text was updated successfully, but these errors were encountered: