
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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

670 Views
Suppose we are creating an application that interacts with the user clicks on the Button visible in the application. To understand how exactly events work, we have to create a callback function as well as a trigger that will execute an event. Whenever the user clicks the button, the event happens and it needs to be captured on the screen.ExampleIn this example, we will create a Listbox widget that will have a list of items in it. When we select an item, then it will capture what the user has clicked. To figure out the captured event, we can use ... Read More

212 Views
Without a doubt, Python has a rich library of modules and extensions that can be used to structure an application the way we want. Tkinter is a well-known Python library that is used for building GUI-based desktop applications. Tkinter offers a robust and platformindependent window toolkit.Tkinter is a package that works on top of Tcl/Tk. It contains a set of implemented classes, wrappers which are written in the Tcl/Tk toolkit.We can use Tkinter for various creating applications such as images gallery, animating objects, Data Analysis, Scientific Calculation, Game Design, and Music applications.Tkinter offers a variety of modules, functions and widgets ... Read More

4K+ Views
Python has a rich set of libraries and modules that can be used to build various components of an application. Tkinter is another well-known Python library for creating and developing GUI-based applications. Tkinter offers many widgets, functions, and modules that are used to bring life to the application visuals. We can create button widgets to perform certain tasks in an application.In this application, we will create a toggle button that will turn the On/ Off Night and Day mode of the application. To create a toggle button, we have to first render the image in a Label.We define buttons and ... Read More

2K+ Views
Focus is used to refer to the widget or window which is currently accepting input. Widgets can be used to restrict the use of mouse movement, grab focus, and keystrokes out of the bounds. However, if we want to focus a widget so that it gets activated for input, then we can use focus.set() method. focus() is sometimes referred to as focus_set().focus_set() focuses on the widget when its window or widget gets focus.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 ... Read More

1K+ Views
To display a list of items in the application, Tkinter provides a Listbox widget. It is used to create a list of items vertically. When we want to change the text a specific Listbox item, then we have to first select the item by iterating over the listbox.curselection() and insert a new item after deletion. To insert a item in the list, you can use listbox.insert(**items).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") # Create ... Read More

18K+ Views
Tkinter Treeview widget is used to display the data in a hierarchical structure. In this structure, each row can represent a file or a directory. Each directory contains files or additional directories. If we want to create a Treeview widget, then we can use Treeview(parent, columns) constructor to build the table.The Treeview widget items can be edited and deleted by selecting the item using tree.selection() function. Once an item is selected, we can perform certain operations to delete or edit the item.Example# Import the required libraries from tkinter import * from tkinter import ttk # Create an instance of tkinter ... Read More

2K+ Views
The canvas widget has two coordinate systems: (a) Window coordinate system and (b) canvas coordinate system. The window coordinate system always starts from the leftmost corner (0, 0) in the window, while the canvas coordinate system specifies where the items are actually placed in the canvas.To convert the window coordinate system to canvas coordinate system, we can use the following two methods, canvasx(event.x) canvas(event.y)If we consider the case for the window coordinate system, then mouse events occur only in the window coordinate system. We can convert the window coordinate to a canvas coordinate system.ExampleIn this application, we will get the ... Read More

6K+ Views
While building an application with Tkinter, we can use many components and widgets to extend the application. To render the widgets in the application, we use the Geometry Manager.The geometry manager configures the widget position and size within the window. The Grid Geometry manager treats the widget to place in rows and columns.If we want to span the widget and extend in one more cell or column, we use widget.rowconfigure() or widget.grid_rowconfigure(). It takes params such as weight and row/col value.The widget.rowconfigure() is sometimes used in place of widget.grid_rowconfigure(). Using these methods will allow the widget to have a weight property ... Read More

3K+ Views
Python has many inbuilt libraries and modules that are used for building various application interfaces and components. Pygame is one of the python modules which is used to design and build video games and music. It provides a mixture to handle all sound related activities. Using music sub-module, you can stream mp3, ogg, and other variety of sounds.To create an application that plays some sound on clicking a button, we have to follow these steps, Make sure that Pygame is installed in your local machine. You can install pygame using pip install pygame command.Initialize Pygame mixture by using pygame.mixture.init()Create a button widget which is ... Read More

1K+ Views
A Button widget in Tkinter has many inbuilt features which can be used to configure and perform a certain task in the application. In order to run a particular event in the application, we can use the bind("", callback) method to bind a function or event with the button. To add the hover property in the Button, we can use and parameters in the bind function.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") def change_bgcolor(e): ... Read More