How would I be able to have a button that's command is to return it's text in the button to a variable
CodingCabbage
0
Light Poster
Recommended Answers
Jump to PostYou 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
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.