Dev Prakash Sharma has Published 548 Articles

Tkinter dropdown Menu with keyboard shortcuts

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 25-May-2021 08:49:46

1K+ Views

A Dropdown Menu is nothing but a list of vertically stacked menu items that can be visible at the top Menu Bar of an application. We can create a Menu bar in a Tkinter application by creating an object of Menu() in which all the Menu items are present.There might be ... Read More

How to bind events to Tkinter Canvas items?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 25-May-2021 08:49:19

2K+ Views

Tkinter events can be bound with the widgets to perform a set of operations on the widgets. To be more specific, we can also bind an event handler to Canvas Items by using bind(, callback) method. Binding the event with the canvas item makes a canvas item dynamic which can be ... Read More

How to specify where a Tkinter window should open?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 25-May-2021 08:47:17

10K+ Views

Tkinter window can be configured using the Geometry Manager. When we specify the main window using the geometry(width x height + position_right + position_left) method, then we generally enable the window to open in a particular position.Example#Import the required libraries from tkinter import * #Create an instance of Tkinter ... Read More

How to bind the spacebar key to a certain method in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 04-May-2021 14:45:24

2K+ Views

Tkinter methods can be bound with the Keys or Mouse to perform certain operations or events in an application. Let us suppose for a particular application, we want to bind the Key such that it will perform a certain operation. We can bind any key to a particular operation ... Read More

How to change font size in ttk.Button?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 04-May-2021 14:28:22

5K+ Views

Tkinter Ttk is a native library in Tkinter which is used to style the widgets in a Tkinter application. It provides a native GUI interface to all the widgets defined in the application.In order to style the widgets with ttk, we have to import it in the notebook using the ... Read More

How to change the color of a Tkinter label programmatically?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 04-May-2021 14:27:43

17K+ Views

Tkinter Label widgets are used to add text or images to the application. We can even configure the basic properties of labels using the config(options) method. Generally, in order to configure the widgets property dynamically, we use callback functions where we modify the value of attributes.ExampleIn this example, we will ... Read More

How to change the title bar in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 04-May-2021 14:27:13

22K+ Views

Tkinter initially sets a default title bar for every application. We can update or replace the Title Bar of the Tkinter application by configuring the title("Enter any Title") method. For a particular application, let us see how we can change the title of a Tkinter application that calculates the square ... Read More

How to connect a progress bar to a function in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 04-May-2021 14:26:46

3K+ Views

A Progress Bar helps to visualize the state of a running process. We have used and interacted with many progress bars such as getting the status of downloading a file from the internet, Loading a file on the local system, etc.Let us suppose that we want to create and connect ... Read More

How to create a message box with Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 04-May-2021 14:26:28

3K+ Views

In a particular application, we can create messagebox using messagebox method. Here is the list of messagebox we can create for a particular application, showinfo() - to show a general message on the screen.showwarning() - to show the warning to the user.showerror() - Display error message.askquestion() - Query the user ... Read More

How to disable a Combobox in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 04-May-2021 14:25:48

4K+ Views

The Combobox widget is similar to the OptionMenu widget in Tkinter which gives the user a choice to select from the group of options. The Combobox widget allows users to select the option with an Entry widget that adds selected menu items from the dropdown list.We can Enable or Disable ... Read More

Advertisements