import tkinter as tk from gui_core.wrap import Button def button_clicked(event): print("Button clicked!") root = tk.Tk() button = Button(root, text="Click me") button.bind("", button_clicked) root.mainloop()
import tkinter as tk from gui_core.wrap import Button root = tk.Tk() def button_clicked(): print("Button clicked!") button = Button(root, text="Click me", command=button_clicked) button.pack() root.mainloop()This example creates a button widget using the `gui_core.wrap.Button` class, and assigns the `button_clicked` function to the `command` parameter. When the button is clicked, the `button_clicked` function will be executed and the message "Button clicked!" will be printed to the console. Package library: `gui_core`