Scroll with Python

0

Hello in this code that I'm doing as practice gives me an error, the code is:

    #----------cuadros a rellenar-----------
miFrame=Frame(root)
miFrame.pack()

miId=StringVar()
minombre=StringVar()
miPasword=StringVar()
miApellido=StringVar()
miDireccion=StringVar()
miComentarios=StringVar()


cuadroID=Entry(miFrame,textvariable=miId)
cuadroID.grid(row=0,column=1,padx=10,pady=10)
cuadroID.config(bg="green")

cuadroNombre=Entry(miFrame,textvariable=minombre)
cuadroNombre.grid(row=1,column=1,padx=10,pady=10)
cuadroNombre.config(fg="red",justify="right")

cuadroPasword=Entry(miFrame,textvariable=miPasword)
cuadroPasword.grid(row=2,column=1,padx=10,pady=10)
cuadroPasword.config(show="*")

cuadroApellido=Entry(miFrame,textvariable=miApellido)
cuadroApellido.grid(row=3,column=1,padx=10,pady=10)

cuadroDirección=Entry(miFrame,textvariable=miDireccion)
cuadroDirección.grid(row=4,column=1,padx=10,pady=10)

cuadroComentarios=Entry(miFrame,textvariable=miComentarios)
cuadroComentarios.grid(row=5,column=1,padx=10,pady=10)
scrolVert=Scrollbar(miFrame, command=cuadroComentarios.yview)
scrolVert.grid(row=5,column=2,sticky="nsew")
cuadroComentarios.config(yscrollcommand=scrolVert.set)

The error that gives me in Visual Studio Code is the following:

  

File "c: \ Users \ User \ Desktop \ examples \ Python \ PracticaGuiada_1 \ practica_mia.py",   line 112, in       scrolVert = Scrollbar (myFrame, command = tableComments.yview) AttributeError: 'Entry' object has no attribute 'yview'

    
asked by José Manuel González 23.10.2018 в 12:26
source

1 answer

0

I have already found the solution or at least the code works for me

cuadroComentarios=Entry(miFrame,textvariable=miComentarios)

Change Entry by Text

Comment box = Text (myFrame, textvariable = myComments)

    
answered by 23.10.2018 в 12:47