(May-12-2018, 06:05 PM)Larz60+ Wrote: write it this way:Sorry but it has the same problem as Epilepsy had. He needs to bind the buttons to an event. See post #2
from tkinter import * import tkinter as tk def write_slogan(v): print(v) root = tk.Tk() frame = tk.Frame(root) frame.pack() btns = [] for k in range(0, 11, 1): btns.append(tk.Button(frame, text=str(k), command=lambda: write_slogan(k))) btns[k].pack(side=tk.LEFT) root.mainloop()
Problem with buttons
Messages In This Thread |
Problem with buttons - by Epilepsy - May-12-2018, 05:13 AM
RE: Problem with buttons - by Barrowman - May-12-2018, 03:38 PM
RE: Problem with buttons - by woooee - May-12-2018, 04:41 PM
RE: Problem with buttons - by Larz60+ - May-12-2018, 06:05 PM
RE: Problem with buttons - by Barrowman - May-12-2018, 09:23 PM
RE: Problem with buttons - by Larz60+ - May-12-2018, 11:28 PM
|
Users browsing this thread: 2 Guest(s)