
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to get an element to stick to the bottom-right corner in Tkinter?
Tkinter has many inbuilt features, functions, and methods that we can use to construct the GUI of an application. It is necessary to know how we can set the position of a particular widget in the application so that it becomes responsive in nature.
Tkinter also provides geometry managers through which we can set the position of elements and widgets. The Place geometry manager is used for configuring the position of complex widgets.
Example
Let us suppose that we want our widget position to the bottom-right of the application window, then we can use place geometry manager with anchor property.
# Import the required libraries from tkinter import * from tkinter import ttk # Create an instance of tkinter frame or window win=Tk() # Set the size of the window win.geometry("700x350") # Add buttons in the frame button1=ttk.Button(win, text="Button-1") button1.place(rely=1.0, relx=1.0, x=0, y=0, anchor=SE) win.mainloop()
Output
Running the above code will place the widget at the bottom-right of the window.
- Related Questions & Answers
- Set bottom-right corner border with CSS
- Java Program to place component in bottom-right corner with BorderLayout
- How to set the shape of the border of the bottom-right corner in JavaScript DOM?
- How to set the bottom margin of an element?
- Program to find minimum number of cells it will take to reach bottom right corner in Python
- Set the left, right, top and bottom padding of an element
- How to show (0,0) on matplotlib graph at the bottom left corner?
- How to position text to bottom right on an image with CSS
- How to set the bottom margin of an element with JavaScript?
- How to set the bottom padding of an element with JavaScript?
- How to set the shape of the border of the bottom-left corner in JavaScript DOM?
- Float an element to the right with Bootstrap 4
- How to set the right padding of an element with JavaScript?
- How to set the right margin of an element with JavaScript?
- How to set the shape of the border of the top-right corner with JavaScript?
Advertisements