How would I be able to have a button that's command is to return it's text in the button to a variable
Jump to Post
You could bind the event to pass certain arguments ...
# Tkinter, show the text of the button that has been clicked # for Python3 use tkinter import Tkinter as tk def click(event): s = "clicked: " + event.widget.cget("text") root.title(s) root = tk.Tk() root.geometry("300x50+30+30") b1 = tk.Button(root, …
All 2 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.