0

I'm wondering if it's possible to change the border color of a tkinter entry widget border. I don't think it is, because no such option exists in relevant documentation. You can change the width, but that just results in the whitespace being recessed - creating a raised 3d border.

If it can't be done, would it be more valid to use a frame around the widget? Is it possible to combine the border width and a frame to create a good appearance?

Thank you.

2
Contributors
2
Replies
5
Views
7 Years
Discussion Span
Last Post by Ene Uran
1

Actually, a frame alone is enough to produce the effect I desired. I'm sorry to waste space and time.

Here's the code.

#!/usr/bin/env python
#Python 3.1

from tkinter import *

master = Tk()
nameentryframe = Frame(master, background = 'BLACK', borderwidth = 1, relief = SUNKEN)
nameentry = Entry(nameentryframe)
nameentryframe.pack()
nameentry.pack()

master.mainloop()
0

Thanks for letting us know. I would have done it the same way too, since Frame has the convenient borderwidth arg.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.