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,
- Read JSON File in Python Program
- Convert Float to String in Python
- Python - Convert float to String
- Check if String Contains a Substring - Python
- Install and Run Jupyter Notebook on Mac (macOS)
- Sorting an array using Bubble Sort in Python Programming
- Comments in Python Programming
- 3 Python program to add two numbers
- Read a file line by line in Python Program
- How to uninstall pip Python packages
- Change label (text) color in tkinter
- 7 Python Arithmetic Operators with Examples [Tutorial]
- pip get list of all outdated Python packages
- Where does brew install python in macOS
- How to Convert String to DateTime in Python
- Python: Fix command not found pip or pip3 on zsh shell
- How to add borders to tkinter label text
- ModuleNotFoundError: No module named qdarkstyle.colorsystem [Python]
- TypeError: must be str, not int
- Python Program To Calculate Simple Interest (SimpleInterest.py)
- Check version of pip package installer for Python
- Change the background of Tkinter label or text
- Set width and height for the label in tkinter
- How to write JSON file in Python Program
- Python raise error with message example
More Posts:
- How to serialize-deserialize an object in java - Java
- Android Studio : Connection Error : Failed to download patch file - Android-Studio
- Java SE 8 Update 301 available with various bug fixes and security improvements - Java
- Java: Check Internet connection on Android Device (Wifi or Mobile) - Android
- How to enable line numbers in IntelliJ Android Studio for all files - Android-Studio
- Unhandled exception type InterruptedException : Java Threads - Java
- How to identify installed Java (JDK) Version on macOS - MacOS
- How to Generate Self-Signed OpenSSL certificate in three easy steps - HowTos