Issue
import tkinter
from tkinter import*
from tkinter import messagebox
screen=Tk()
screen.title("hi")
screen.geometry("%dx%d+%d+%d" % (800,400,200,200))
txt=Text(screen, height=20).place(x=0,y=0,)
lbl1=Label(screen, text="name :").place(y=350,x=0)
txt2=Entry(screen).place(x=45,y=350)
btn1=Button(screen, text="submit").place(y=345,x=200)
btn1.canfigure(state=DISABLED)
screen.mainloop()
When, I use configure on btn. I get error. but I watch the tutorial videos and I don't see any different between my code and theirs
Solution
first replace your
btn1.canfigure(state=DISABLED)
with
btn1.configure(state=DISABLED)
Then separete the creating and placement of the button here is the corrected code it runs fine on my end:
import tkinter
from tkinter import *
from tkinter import messagebox
screen = Tk()
screen.title("hi")
screen.geometry("%dx%d+%d+%d" % (800, 400, 200, 200))
txt = Text(screen, height=20)
txt.place(x=0, y=0)
lbl1 = Label(screen, text="name :").place(y=350, x=0)
txt2 = Entry(screen)
txt2.place(x=45, y=350)
btn1 = Button(screen, text="submit")
btn1.place(y=345, x=200)
btn1.configure(state=DISABLED)
screen.mainloop()
Answered By - Cem Koçak
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.