Dev Prakash Sharma has Published 556 Articles

How to use the Entry widget in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 06-Aug-2021 07:44:00

1K+ Views

The Entry widget is a single-line text widget defined in Tcl/Tk toolkit. We can use the Entry widget to accept and display single-line user input.In order to use the Entry widget, you have to first create an Entry widget using the constructor Entry(parent, width, **options). Once we've defined our Entry ... Read More

How to create a Tkinter error message box?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 06-Aug-2021 07:40:41

14K+ Views

The Tkinter library has many built-in functions and methods which can be used to implement the functional part of an application. We can use messagebox module in Tkinter to create various popup dialog boxes. The messagebox property has different types of built-in popup windows that the users can use in ... Read More

How to change Tkinter label text on button press?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 06-Aug-2021 07:29:13

8K+ Views

Most often, Tkinter Label widgets are used in the application to display the text or images. We can configure the label widget such as its text property, color, background or foreground color using the config(**options) method.If you need to modify or change the label widget dynamically, then you can use ... Read More

How to reconfigure Tkinter canvas items?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 06-Aug-2021 06:45:03

7K+ Views

Using the Canvas widget, we can create text, images, graphics, and visual content to add to the Canvas widget. If you need to configure the Canvas item dynamically, then tkinter provides itemconfig(**options) method. You can use this method to configure the properties and attributes of the Canvas items. For example, ... Read More

How to set justification on Tkinter Text box?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 06-Aug-2021 06:40:30

3K+ Views

The Text widget supports multiline user input from the user. We can configure the Text widget properties such as its font properties, text color, background, etc., by using the configure() method.To set the justification of our text inside the Text widget, we can use tag_add() and tag_configure() properties. We will ... Read More

How to get the widget name in the event in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 06-Aug-2021 06:37:34

2K+ Views

Tkinter is a Python library that is used to create and develop functional GUI-based applications. Tkinter provides widgets that can be used for constructing the visual and functional representation of the application.Let us suppose that we have defined some widgets in our application. If we want to get a widget's ... Read More

How to delete lines from a Python tkinter canvas?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 06-Aug-2021 06:34:33

2K+ Views

The Canvas widget has many use-cases in GUI application development. We can use a Canvas widget to draw shapes, creating graphics, images, and many other things. To draw a line in Canvas, we can use create_line(x, y, x1, y1, **options) method. In Tkinter, we can draw two types of lines ... Read More

How to insert the current time in an Entry Widget in Tkinter?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 06-Aug-2021 06:31:55

2K+ Views

To work with the date and time module, Python provides the 'datetime' package. Using the 'DateTime' package, we can display the date, manipulate the datetime object and use it to write the additional functionality in the application.To display the current date in a Tkinter window, we've to first import the ... Read More

How to display an image/screenshot in a Python Tkinter window without saving it?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 06-Aug-2021 06:27:38

1K+ Views

Tkinter is a standard Python library that is used to create and develop GUI-based applications. To display an image, we use the PIL or Pillow library.Let us suppose that we want to create an application that will take a screenshot of the window and display the captured image in another ... Read More

How to draw a line on a Tkinter canvas?

Dev Prakash Sharma

Dev Prakash Sharma

Updated on 06-Aug-2021 06:24:26

16K+ Views

Tkinter Canvas widget can be used for multiple purposes such as drawing shapes, objects, creating graphics and images. To draw a line on a Canvas, we can use create_line(x, y, x1, y1, **options) method.In Tkinter, we can draw two types of lines: simple and dashed. We can specify the type ... Read More

Previous 1 ... 5 6 7 8 9 ... 56 Next
Advertisements