import tkinter as tk class App: def __init__(self, master): frame = tk.Frame(master) frame.pack() self.button = tk.Button(frame, text="Kilépés", fg="red", command=frame.quit) self.button.pack(side=tk.LEFT) self.hi_there = tk.Button(frame, text="Szia", command=self.say_hi) self.hi_there.pack(side=tk.LEFT) def say_hi(self): print("Lenyomott gomb") ablak = tk.Tk() app = App(ablak) ablak.mainloop()