Dev Prakash Sharma has Published 548 Articles

How to capture events on Tkinter child widgets?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 18-Jun-2021 14:16:13

659 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 ... Read More

Where to learn Tkinter for Python?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 18-Jun-2021 14:15:56

209 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 ... Read More

How to create a Tkinter toggle button?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 18-Jun-2021 14:14:23

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 ... Read More

What is the difference between focus and focus_set methods in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 18-Jun-2021 14:03:56

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 ... Read More

How can I change the text of the Tkinter Listbox item?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 18-Jun-2021 13:56:14

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 ... Read More

Delete and Edit items in Tkinter TreeView

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 18-Jun-2021 13:54:55

17K+ 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 ... Read More

How to get coordinates on scrollable canvas in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 18-Jun-2021 13:51:49

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 ... Read More

What is correct: widget.rowconfigure or widget.grid_rowconfigure in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 18-Jun-2021 13:51:32

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 ... Read More

How can I play a sound when a Tkinter button is pushed?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 18-Jun-2021 13:51:06

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, ... Read More

How to make a Button Hover to change the Background Color in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 18-Jun-2021 13:50:50

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 ... Read More

Advertisements