Issue
def com():
...
entryy=Entry()
entryy.pack()
button=Button(text="Enter!", command=com, font=(24))
button.pack(expand="yes", anchor="center")
As I said how do I disable Entry in com
function?
Solution
Set state
to 'disabled'
.
For example:
from tkinter import *
root = Tk()
entry = Entry(root, state='disabled')
entry.pack()
root.mainloop()
or
from tkinter import *
root = Tk()
entry = Entry(root)
entry.config(state='disabled') # OR entry['state'] = 'disabled'
entry.pack()
root.mainloop()
So the com
function should read as:
def com():
entry.config(state='disabled')
Answered By - falsetru
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.