Using Tkinter to make GUI’s in python, THE MUST KNOW WIDGETS OF TKINTER.
Tkinter is one of the most easiest python libraries to develop GUI applications.With its widgets Tkinter is easy to remember and can be mastered within a week.The reason why this blog is different because I will be covering the most practical parts of the library that you will need in almost every program!The rest is basic python that controls the interactions in your apps. I will cover those functions that seem simple but can be used for building complex programs later.
Lets dive into the basics and the most practical features of Tkinter:)
Exciting isn’t it! A window created withing 4 lines of code. Now its time to work with the basic and the most common widgets of Tkinter
Tkinter widgets are the controls that can be set on the window and can be used for interaction between the user and the program
The Label Widget(Displaying text on window):
the use of “label” was as a variable to store the Label widget in tkinter. “tk.Label” is the code used to let the IDE know the type of widget to be displayed on the “tk” window. Within the parenthesis we write down the text to be displayed. “.grid()” is a very important part which will position the text.
IMPORTANT NOTE: Without .grid() the particular widget will not be seen on the window as there is no position given.
The Button Widget:
We follow the same format of displaying widgets on almost 80% of the widgets, the only difference is that we write tk.Button,tk.Label etc.
The Entry widget( Text Box):
The entry widget has a different format but it still resembles the format of previous widgets.
Only difference is that we do not place text inside the parenthesis as this is an input field so you cannot put default text inside it. And another small difference is that .grid() is put in the next line with the variable assigned to “tk.Entry()” , this is the basic syntax by the developers for the entry field for some unknown reason(GUIs are still a mystery).
The RadioButton( Option Button):
Not this :
What it really is:
You can use tk.Radiobutton too but either is fine. value is an exclusive property given only to Radiobuttons , 0 means not selected and 1 means selected at runtime by default.
These are the basic Tkinter codes and syntaxes to create a simple window with display features only. Follow this Blog to know more on how to make complex functions and apps with this powerful python GUI library. I will also be making a course on in-depth analysis and teaching of Tkinter and how python works with it.
Once you have learnt coding, you can sell your apps and for that you need to advertise, for that you need to make PRO GRAPHIC CONTENT, take a look at this app that helps you achieve successful advertisement content:
https://www.digistore24.com/redir/431162/H_Droid743/