Python Forum
Disable entry field and still see value
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Disable entry field and still see value
#1
Is there a way to disable an entry field and yet still see the value in it? For Tkinter.
Reply
#2
Haven't tested it. But what a search turned up.
https://stackoverflow.com/questions/1987...able-entry
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags


Reply
#3
Yeh. I know how to disable the entry but when it's disabled, I still need to see the value in the entry field.
Reply
#4
This works
import tkinter as tk

root = tk.Tk()
en = tk.Entry(root)
en.insert(0, 'some text here')
en.configure(state=tk.DISABLED)
en.pack()
root.mainloop()
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags


Reply
#5
That worked. Thank you!
Reply
#6
On a side note you can change the foreground and background colors in the configure

en.configure(state='tk.DISABLED', disabledbackground='white', disabledforeground='red')
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags


Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] binding versus disable DPaul 6 6,599 May-05-2021, 05:17 PM
Last Post: DPaul
  How to disable custom button Sancho_Pansa 7 3,415 Dec-04-2020, 02:21 PM
Last Post: buran
  How to disable focus on Frame in Tkinter? szafranji 1 2,971 May-13-2020, 10:45 PM
Last Post: DT2000
  Converting Entry field value to integer in tkinter scratchmyhead 2 4,884 May-11-2020, 03:41 PM
Last Post: scratchmyhead
  [Tkinter] Unable to get current contents of the entry field where the content is the file path pmpinaki 1 2,193 Apr-18-2020, 06:45 PM
Last Post: deanhystad
  Transfer Toplevel window entry to root window entry with TKinter HBH 0 4,420 Jan-23-2020, 09:00 PM
Last Post: HBH
  [Tkinter] how can disable menu [About] when Toplevel is active balenaucigasa 0 2,642 Oct-25-2019, 09:49 PM
Last Post: balenaucigasa
  [Tkinter] how to get the entry information using Entry.get() ? SamyPyth 2 3,453 Mar-18-2019, 05:36 PM
Last Post: woooee
  Disable Enter Key PyQt5 Wizard maffaz 1 6,657 Jul-02-2018, 09:45 AM
Last Post: maffaz
  [Tkinter] Disable anti aliasing for text AnonymousNobody 3 6,784 Aug-11-2017, 07:54 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

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