There are a lot of border types that you can choose from while using Python Tkinter Label.
- flat
- raised
- sunken
- ridge
- solid
- groove
1. Flat
tkinter - flat label border
Code Snippet:
from tkinter import *
window = Tk()
my_text_label = Label(window, text='This is a label with flat border', borderwidth=2, relief='flat')
my_text_label.pack(padx=10, pady=10)
window.mainloop()
2. Raised
tkinter - raised label border
Code Snippet:
from tkinter import *
window = Tk()
my_text_label = Label(window, text='This is a label with raised border', borderwidth=2, relief='raised')
my_text_label.pack(padx=10, pady=10)
window.mainloop()
3. Sunken
tkinter - flat label border
Code Snippet:
from tkinter import *
window = Tk()
my_text_label = Label(window, text='This is a label with sunken border', borderwidth=2, relief='sunken')
my_text_label.pack(padx=10, pady=10)
window.mainloop()
4. Ridge
tkinter - flat label border
Code Snippet:
from tkinter import *
window = Tk()
my_text_label = Label(window, text='This is a label with ridge border', borderwidth=2, relief='ridge')
my_text_label.pack(padx=10, pady=10)
window.mainloop()
5. Solid
tkinter - solid label border
Code Snippet:
from tkinter import *
window = Tk()
my_text_label = Label(window, text='This is a label with solid border', borderwidth=2, relief='solid')
my_text_label.pack(padx=10, pady=10)
window.mainloop()
6. Groove
tkinter - groove label border
Code Snippet:
from tkinter import *
window = Tk()
my_text_label = Label(window, text='This is a label with groove border', borderwidth=2, relief='groove')
my_text_label.pack(padx=10, pady=10)
window.mainloop()
More Posts related to Python,
- Python: Convert Date to DateTime
- How to sort a List using Lambda in Python
- Python matplotlib segmentation fault: 11 macOS Big Sur
- What is Terminal Velocity and its Formula? How to calculate it programmatically?
- How to install Python 3.11 on Mac
- How to flatten a nested list in Python
- Python: Pandas Merge DataFrames on Index Example
- How to Run all Cells at Once Jupyter Notebook
- Python - Convert float to String
- How to add borders to tkinter label text
- How to Exit a Loop in Python Code
- [Python] Fix: ValueError: All arrays must be of the same length
- Sorting an array using Bubble Sort in Python Programming
- How to Unzip a file using Python
- Python: Merge DataFrames Pandas Outer Join Example
- Change label (text) color in tkinter
- Convert Float to String in Python
- Fix: fatal error: No such file or directory compilation terminated
- Python: Access index/counter of a for loop iteration
- Import Other Python Files Examples
- How to install Anaconda on Mac (M1/M2 Mac)
- Python Regular Expression to Find All Matches in List
- How to Read a binary File with Python
- How to disable warnings while Python file execution
- Know current Python Version
More Posts:
- Android Lint app_name is not translated in af (Afrikaans) am (Amharic) ar (Arabic) bg (Bulgarian) - Android
- Unzip a Zip file from Terminal Command - HowTos
- How to update Android Studio - Android-Studio
- [Fix] TypeError: str object is not callable in Python - Python
- How to find the path of formula Installation by Brew - HowTos
- Get the Size of HTTP Response using cURL Command (Content Length) - cURL
- How to fix Microsoft Windows 10 update error 80070020 - Microsoft
- Open New Terminal Window Using Keyboard Shortcut macOS - MacOS