Python Forum
Newbie question with Tkinter Entry
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Newbie question with Tkinter Entry
#2
Separate the line for the grid statement and it will run the same as the other but using grid instead of the pack method..

from tkinter import *
root=Tk()
root.title("teste ao programa")
#root.configure(background="black")
lopes=Entry(root,fg="red")
lopes.grid(row=1,column=1)
#lopes.pack()
lopes.focus_set()
def ola():
    print(lopes.get())
    lopes.delete(0,END)
b=Button(root,text="OK",width=6,command=ola).grid(row=1,column=0,sticky=W)
#b.pack()
mainloop()
"Often stumped... But never defeated."
Reply


Messages In This Thread
Newbie question with Tkinter Entry - by mariolopes - Oct-12-2019, 03:50 PM
RE: Newbie question with Tkinter Entry - by DT2000 - Oct-12-2019, 10:41 PM
RE: Newbie question with Tkinter Entry - by Larz60+ - Oct-12-2019, 11:02 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Beginner question re: Tkinter geometry return2sender 3 967 Jun-19-2023, 06:19 PM
Last Post: deanhystad
  Tkinter GUI question texan1836 3 1,933 Apr-13-2023, 03:12 AM
Last Post: deanhystad
  simple tkinter question function call not opening image gr3yali3n 5 3,465 Aug-02-2022, 09:13 PM
Last Post: woooee
  [Tkinter] Making entry global in tkinter with multiprocessing luckyingermany 2 2,344 Jan-21-2022, 03:46 PM
Last Post: deanhystad
  Tkinter Exit Code based on Entry Widget Nu2Python 6 3,020 Oct-21-2021, 03:01 PM
Last Post: Nu2Python
  [Tkinter] Update variable using tkinter entry methon drSlump 6 5,248 Oct-15-2021, 08:01 AM
Last Post: drSlump
  Tkinter | entry output. Sap2ch 1 2,016 Sep-25-2021, 12:38 AM
Last Post: Yoriz
  [Tkinter] question for a tkinter dialog box RobertAlvarez424 2 2,271 Aug-25-2021, 03:08 PM
Last Post: RobertAlvarez424
  .get() from generated Entry widgets in tkinter snakes 4 4,258 May-03-2021, 11:26 PM
Last Post: snakes
  Python tkinter question tablet Nick_tkinter 8 5,081 Mar-04-2021, 10:44 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020