I realized after a lot of digging. No matter how hard I try to find this, I believe that others will benefit from this:
The standard style applied to ttk.Entry simply does not accept the fieldbackground parameter to change the color of the text input field. The solution is to create a new element that responds to this option.
from tkinter import * from tkinter import ttk root_window = Tk() estyle = ttk.Style() estyle.element_create("plain.field", "from", "clam") estyle.layout("EntryStyle.TEntry", [('Entry.plain.field', {'children': [( 'Entry.background', {'children': [( 'Entry.padding', {'children': [( 'Entry.textarea', {'sticky': 'nswe'})], 'sticky': 'nswe'})], 'sticky': 'nswe'})], 'border':'2', 'sticky': 'nswe'})]) estyle.configure("EntryStyle.TEntry", background="green", foreground="grey", fieldbackground="black") entry_v = StringVar() entry = ttk.Entry(root_window, style="EntryStyle.TEntry", textvariable=entry_v) entry.pack(padx=10, pady=10)
Unfortunately, it seems that the only way to change the color of the border is to either give it a zero border width, or embed it in a frame that acts as its border, or define a new layout element that uses the image as a border.
Also, note that background control is a very small corner space; if you squint, you can see one pixel of green in each corner.
To use the image as a frame, you can do this:
img2 = PhotoImage("entryBorder", data=""" R0lGODlhHQAdAOMNAAAAAAQGCAgLERkfLR0mODBFZTFFZTNIajtTezxTez1XgD5XgU Fch////////////ywAAAAAHQAdAAAEbHCQg5i9OGt0iFRaKGLKxBgCoK5s6woGc4Cp a9+AwFQM7ruYn1AVHP6KRhwyaVsyW87nKioFUKXXZ5a5TXaN32FYOD5eqsAzmlX2tZ XqNZGxYATkgAD9wCjUqgIFMgR1I4YZCx4TCYeGCR0DEQA7""") oestyle = ttk.Style() oestyle.element_create("blueborder", "image", "entryBorder", border=3, sticky="nsew") oestyle.layout("OEntryStyle.TEntry", [('Entry.blueborder', {'children': [( 'Entry.padding', {'children': [( 'Entry.textarea', {'sticky': 'nswe'})], 'sticky': 'nswe'})], 'sticky': 'nswe'})]) oestyle.configure("OEntryStyle.TEntry", background="black", foreground="grey") oentry_v = StringVar() oentry = ttk.Entry(root_window, style="OEntryStyle.TEntry", textvariable=oentry_v) oentry.pack(padx=10, pady=10)
A character string is generated by supplying an image of the borders that I want as a gif so that
import base64 with open('otherframeBorder.gif', 'rb') as f: encoded = base64.encodestring(f.read()) print(encoded.decode('latin1'))