Border for tkinter Label
<p>Not really relevant but i'm building a calendar and I have a lot of Label widgets, and therefore it will look alot nicer if I had some borders for them!</p>

<p>I have seen you can do this for other widgets such as Button, Entry and Text.</p>

<p>Minimal code:</p>

<pre><code>from tkinter import *

root = Tk()

L1 = Label(root, text="This")
L2 = Label(root, text="That")

L1.pack()
L2.pack()
</code></pre>

<p>I have tried setting</p>

<pre><code>highlightthickness=4
highlightcolor="black"
highlightbackground="black"
borderwidth=4
</code></pre>

<p>inside the widget, but still the same result.</p>

<p><a href="http://i.stack.imgur.com/h2NUB.png" rel="nofollow"><img src="http://i.stack.imgur.com/h2NUB.png" alt="example pic tkinter"></a></p>

<p>Is this even possible to do? Thank you!</p>

<p>If you want a border, the option is <code>borderwidth</code>. You can also choose the relief of the border (<code>"flat"</code>, <code>"raised"</code>, <code>"sunken"</code>, <code>"ridge"</code>, <code>"solid"</code>, <code>"groove"</code>).</p>

<p>For example:</p>

<pre><code>l1 = Label(root, text="This", borderwidth=2, relief="groove")
</code></pre>

<hr>

<p>Note: <code>"ridge"</code> and <code>"groove"</code> require at least two pixels of width to render properly</p>

<p><a href="http://i.stack.imgur.com/DduC2.png" rel="nofollow"><img src="http://i.stack.imgur.com/DduC2.png" alt="examples of tkinter borders"></a></p>

python tkinter