I am creating a GUI application using Tkinter
that has a number pad and output of dialed numbers after pushing respective buttons. I've searched a little on Tkinter labels and appending them but I can't seem to find anything that works for what I need. I made a function called AppendDialEntry()
and assigned that function to each button with the symbol as a passed parameter to append what is already in the label.
Here is a sample of the Append function:
def AppenddialEntry(string):
dialInput = dialEntry.cget("text") + string
dialEntry.config(text=dialInput)
dialEntry = tk.Label(root, text="")
dialEntry.grid(row=0, column=4)
And here is one of the buttons:
number_3 = tk.Button(root, text="3", command=AppendDialEntry("3"))
I am also attaching the GUI to show what I am getting.
source https://stackoverflow.com/questions/75268763/python-tkinter-dialing-functionality
Comments
Post a Comment