Dev Prakash Sharma has Published 585 Articles

How to stop copy, paste, and backspace in text widget in tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 16-Dec-2021 11:19:01

The Text widget accepts multiline user input, where you can type text and perform operations like copying, pasting, and deleting. There are certain ways to disable the shortcuts for various operations on a Text widget.In order to disable copy, paste and backspace in a Text widget, you’ve to bind the ... Read More

How to get the index of selected option in Tkinter Combobox?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 16-Dec-2021 11:15:20

If you want to create a dropdown list of items and enable the items of list to be selected by the user, then you can use the Combobox widget. The Combobox widget allows you to create a dropdown list in which the list of items can be selected instantly. However, ... Read More

How to get an Entry box within a Messagebox in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 16-Dec-2021 11:08:22

There are various methods and built-in functions available with the messagebox library in tkinter. Let's assume you want to display a messagebox and take some input from the user in an Entry widget. In this case, you can use the askstring library from simpledialog. The askstring library creates a window ... Read More

How to attach a vertical scrollbar to a Treeview using Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 16-Dec-2021 11:05:44

If you want to display a list of items that contains some columns in it, then you can use the Treeview widget in Tkinter. The Treeview widget allows the user to add a large number of lists along with the properties that can be customized instantly.If you want to attach ... Read More

How to disable multiselection on Treeview in tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 16-Dec-2021 11:04:14

The Treeview widget is used to display a list of items with more than one feature in the form of columns. By default, the listed items in a Treeview widget can be selected multiple times, however you can disable this feature by using selectmode="browse" in the Treeview widget constructor. The ... Read More

How to take input in a text widget and display the text in tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 16-Dec-2021 11:01:59

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

How to clear the text field part of ttk.Combobox in tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 16-Dec-2021 11:00:13

The Combobox widget is one of the versatile widgets in tkinter that is used to create a dropdown list containing some values in it. You can select a value from the dropdown list that gets replaced by the default value of the combobox widget. You can create a combobox widget ... Read More

Call the same function when clicking a Button and pressing Enter in Tkinter

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 16-Dec-2021 10:58:25

There are various built-in functions, widgets and methods available in the tkinter toolkit library which you can use to build robust and powerful desktop applications. The Button widget in tkinter helps users in creating buttons and performing different actions with the help of its functions. You can also bind the ... Read More

How do I open a website in a Tkinter window?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 16-Dec-2021 10:56:45

Tkinter offers many built-in functions and methods that contain several utility functions to help us construct a user-friendly application. In tkinter, if you want to open a webpage, you can use the built-in Python library, webview, which allows the users to view the HTML content in its own native GUI ... Read More

Python Tkinter – How to position a topLevel() widget relative to the root window?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 16-Dec-2021 10:55:30

In Tkinter, the toplevel widget is used to create a popup modal window. The popup window created by the toplevel window works similar to the default window of the tkinter application. It can have widgets such as text widget, button widget, canvas widget, frame, etc.The size and position of the ... Read More

Advertisements