Dev Prakash Sharma has Published 556 Articles

Default window color Tkinter and hex color codes in Tkinter

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 25-May-2021 08:50:36

1K+ Views

A Tkinter window can be customized by adding the properties and attributes such as background color, foreground color, width, height, etc.The color attribute in config() defines the default color of the main window. We can set the color of the window by defining either Hex Color (e.g., #000 for Black) or ... Read More

How to compile a Python 3 app to an .exe using Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 25-May-2021 08:50:13

3K+ Views

Python is well-known for its rich library of extensions and packages. We can import and install the necessary packages from the library. However, if we require to run a Tkinter application with an executable file in Windows Operating System, then we can use the Pyinstaller package in Python. It converts a ... Read More

Tkinter dropdown Menu with keyboard shortcuts

Dev Prakash Sharma

Dev Prakash Sharma

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

926 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

7K+ 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

4K+ 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

16K+ 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

18K+ 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

2K+ 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

Advertisements