- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 310 Articles for GUI-Programming
![Dev Prakash Sharma](https://www.tutorialspoint.com/assets/profiles/302800/profile/60_4750-1612521296.jpg)
1K+ Views
We can use the Tkinter text widget to accept multiline user input. We can insert text, display information, and get the output from the text widget.To highlight the currently selected text in a text widget, we can use the tag_add() method that adds a tag in the current text only.Example# Import the required library from tkinter import * # Create an instance of tkinter frame win=Tk() # Set the geometry win.geometry("700x350") # Add a text widget text=Text(win, width=80, height=15, font=('Calibri 12')) # Set default text for text widget text.insert(INSERT, "Tkinter is a Python Library to create ... Read More
![Dev Prakash Sharma](https://www.tutorialspoint.com/assets/profiles/302800/profile/60_4750-1612521296.jpg)
8K+ Views
We can use the Tkinter text widget to insert text, display information, and get the output from the text widget. To get the user input in a text widget, we've to use the get() method. Let's take an example to see how it works.Example# Import the required library from tkinter import * from tkinter import ttk # Create an instance of tkinter frame win=Tk() # Set the geometry win.geometry("700x350") def get_input(): label.config(text=""+text.get(1.0, "end-1c")) # Add a text widget text=Text(win, width=80, height=15) text.insert(END, "") text.pack() # Create a button to get the text input b=ttk.Button(win, ... Read More
![Dev Prakash Sharma](https://www.tutorialspoint.com/assets/profiles/302800/profile/60_4750-1612521296.jpg)
2K+ Views
Tkinter has many inbuilt features, functions, and methods that we can use to construct the GUI of an application. It is necessary to know how we can set the position of a particular widget in the application so that it becomes responsive in nature.Tkinter also provides geometry managers through which we can set the position of elements and widgets. The Place geometry manager is used for configuring the position of complex widgets.ExampleLet us suppose that we want our widget position to the bottom-right of the application window, then we can use place geometry manager with anchor property.# Import the required ... Read More
![Dev Prakash Sharma](https://www.tutorialspoint.com/assets/profiles/302800/profile/60_4750-1612521296.jpg)
2K+ Views
The Treeview widget is used to display the data in a hierarchical structure. Generally, the data is represented through the table that contains a set of rows and columns. We can add the data in the form of a table with the help of the Treeview widget.To configure the position of the item in the column, we can use the anchor property. It sets the position of the Treeview widget column with the given value. Each row in the table is associated with a column. To align the text of the rows towards the right, we can use the anchor ... Read More
![Dev Prakash Sharma](https://www.tutorialspoint.com/assets/profiles/302800/profile/60_4750-1612521296.jpg)
2K+ Views
A System Tray application is always created on the taskbar. Whenever an application is closed by the user, it will get its state running on the taskbar. To identify a System Tray application, we can provide an image or icon to its application.To create a System Tray icon of a Tkinter application, we can use the pystray module in Python. It has many inbuilt functions and methods that can be used to configure the System Tray icon of the application.To install pystray in your machine, you can type "pip install pystray" command in your shell or command prompt.To create a ... Read More
![Dev Prakash Sharma](https://www.tutorialspoint.com/assets/profiles/302800/profile/60_4750-1612521296.jpg)
3K+ Views
The Treeview widget is designed to display the data in a hierarchical structure. It can be used to display the directories, child directories or files in the form of a list. The items present in the Listbox are called Listbox items.The treeview widget includes many properties and attributes through which we can change or modify its default properties. We can change the background of a treeview widget by defining the 'background' property in the constructor.Example# Import the required libraries from tkinter import * from tkinter import ttk # Create an instance of tkinter frame or window win = Tk() ... Read More
![Dev Prakash Sharma](https://www.tutorialspoint.com/assets/profiles/302800/profile/60_4750-1612521296.jpg)
660 Views
The Tkinter application window has many components: window size, title, navbar, menubar-component, etc. To configure the window attributes or properties, we can use the Window Manager toolkit defined in Tcl/Tk.To run the Window Manager attributes, use the command 'wm' with other keywords. The title of the window can be configured by using wm_title("title") or title("title") method.Example# Import the required libraries from tkinter import * # Create an instance of tkinter frame or window win=Tk() # Set the size of the window win.geometry("700x350") # Change the title of the window win.wm_title("My Window") Label(win, text="Hello, Welcome to Tutorialspoint...", ... Read More
![Dev Prakash Sharma](https://www.tutorialspoint.com/assets/profiles/302800/profile/60_4750-1612521296.jpg)
11K+ Views
To create a list of items with a scrollable widget, Tkinter provides the Listbox widget. With the Listbox widget, we can create a list that contains items called List items. Depending upon the configuration, the user can select one or multiple items from the list.If we want to clear the items in the Listbox widget, we can use the delete(0, END) method. Besides deleting all the items in the Listbox, we can delete a single item as well by selecting an item from the Listbox, i.e., by using currselection() method to select an item and delete it using the delete() ... Read More
![Dev Prakash Sharma](https://www.tutorialspoint.com/assets/profiles/302800/profile/60_4750-1612521296.jpg)
3K+ Views
The Tkinter Toplevel window creates an additional window apart from the main window. We can add widgets and components to the newly created top-level window. It supports all the properties of the parent or main window.Sometimes the Toplevel window is also referred to as the child window. To put the child window in front of the parent window, we can use the wm_transient() method.Example# Import the required libraries from tkinter import * from tkinter import ttk # Create an instance of tkinter frame or window win=Tk() # Set the size of the window win.geometry("700x350") win.title("Parent Window") # ... Read More
![Dev Prakash Sharma](https://www.tutorialspoint.com/assets/profiles/302800/profile/60_4750-1612521296.jpg)
7K+ Views
The treeview widget in Tkinter provides a way to represent the data in a hierarchical structure. With the Treeview widget, we can insert our data in the form of a table. The table can have rows and columns in which we can insert the data instantly.We can also configure the properties of the treeview widget such as its color, size, column width, height, row width & height, etc. To set the row height of the Treeview widget, you can create an instance of ttk themed widget where you can specify the rowheight property. The rowheight property will add internal padding ... Read More