RELIEF STYLES IN TKINTER (PYTHON)||relief style in python|tkinter button styles|Tkinter/Python on Android



Introduction

GUI
GUI(Graphical user interface):-Its basically a system of interactive visual components for a software. A GUI displays objects that convey information, and represent actions that can be taken by the user. In simple words it is just representation of the code for user with proper arrangements of widgets.
We need to understand that it does not affect the working of the program.It's only function is to manage how things are going to display.

Tkinter
Tkinter gives us the way in through which we can build a GUI in Python.It can be said as Python interface to the Tk GUI toolkit,which comes with Python.Tkinter is the standard library in Python. When Python and Tkinter are combined then they provide a fast and easy way to create GUI applications. Tkinter provides a powerful object-oriented interface to the Tk GUI toolkit.

Basic steps to start your tkinter-python program are:-
  • Import Tkinter module.
  • Create main window of GUI generally known as Root window.
  • Add widgets you want.
  • Enter the main event loop using root.mainloop() to take action against each operation defined by you.
Widgets
Tkinter provides user to create different objects in their window which are known as Widgets.Example of such Widgets are; buttons, labels and text boxes used in a GUI application.

Relief styles
Relief style of a widget  decide how the widget is going to be presented.
They create simulated 3-D effects around the widget or say a border style.
So when we are creating a GUI "Relief" style becomes an important aspect for proper framing and implementation of the program.

In simple words it is the way in which the borders of the widgets are going to appear in the GUI.


   .FOLLOWING ARE SOME POSSIBLE ATTRIBUTES AND SAMPLES .

You can also Check all the styles using the following code:-

from tkinter import *
import tkinter

root = tkinter.Tk()

spc1=Label(root,text="")
Button1 = tkinter.Button(root, text ="FLAT", relief=FLAT,borderwidth=10 )

spc2=Label(root,text="")
Button2 = tkinter.Button(root, text ="RAISED", relief=RAISED,borderwidth=10 )

spc3=Label(root,text="")
Button3 = tkinter.Button(root, text ="SUNKEN", relief=SUNKEN,borderwidth=10 )

spc4=Label(root,text="")
Button4 = tkinter.Button(root, text ="GROOVE", relief=GROOVE,borderwidth=10 )

spc5=Label(root,text="")
Button5 = tkinter.Button(root, text ="RIDGE", relief=RIDGE,borderwidth=10 )


spc1.pack()
Button1.pack()
spc2.pack()
Button2.pack()
spc3.pack()
Button3.pack()
spc4.pack()
Button4.pack()
spc5.pack()
Button5.pack()
spc5.pack()

root.mainloop()

#---------------CODE ENDS------------


Visit my YouTube channel for more information about Tkinter-https://youtube.com/playlist?list=PLJlSVjTpM95qNG8zD1PmGGx6XJGZwiSo_


"Hope it helped"
Have anything in mind? Let me 
know in the comment section👇
Next Post Previous Post
No Comment
Add Comment
comment url