Code Monkey home page Code Monkey logo

Comments (1)

RedFantom avatar RedFantom commented on June 27, 2024

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.

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()

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:

ttk.Button(root, text="Print 111", command=lambda: print("111")).pack()

Therefore, this does not constitute a bug in the widget, and I will close this issue.

from ttkwidgets.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.