Border for tkinter Label

前端 未结 2 1453
南笙
南笙 2021-01-31 09:07

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!

I have seen you

2条回答
  •  名媛妹妹
    2021-01-31 09:49

    If you want a border, the option is borderwidth. You can also choose the relief of the border: "flat", "raised", "sunken", "ridge", "solid", and "groove".

    For example:

    l1 = Label(root, text="This", borderwidth=2, relief="groove")
    

    Note: "ridge" and "groove" require at least two pixels of width to render properly

提交回复
热议问题