How could I pad the entry widget so it does not start writing right at the border of the widget? Visually, having a little space from the entry widget border.
My progress:
entry_widget.bind('<FocusIn>', lambda f: entry_widget.insert(0, ' '))
That adds an empty space when the user clicks the widget but there are multiple issue with this solution:
When clicking out and clicking back in, it will add another space on top of the empty space or any text the user had filled in. I considered clearing the entry widget on
FocusOut
but that would also clear all the text that the user might have written.The user can delete the inserted space
when getting the content, there is the additional space at the beginning. Though this is a small problem which can be solved by removing the first character of the content.
And there might be more issues which I did not account for.
I think the way where my code is heading is bad, therefore I am asking if anyone has any idea how to 'properly' pad the entry widget?