Skip to content

A python library for centering the Tkinter and PyQt windows.

License

Notifications You must be signed in to change notification settings

MrinmoyHaloi/centerit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pypi Python-3.9.2|3.9.3|3.9.4|3.9.5 platform win|linux

centerit

A python library for centering the tkinter and PyQt windows.

You can use this library to center your Tkinter or PyQt windows both horizontally and vertically. That means your window will show in the middle of the screen.

How to install

pip install centerit

or

Clone the repository using

git clone https://github.com/MrinmoyHaloi/centerit

or download as a zip file and extract it.

How to use

import everything from the library using

from centerit import *

Then Call centertk for Tkinter

centertk(root, width, height)

and centerqt for PyQt5

centerqt(root, width, height)

You just have to pass the root window name and the dimensions you want for your root window.

I used python 3.9.5 to develop it. I used windows 10 20H2 and parrot OS 4.11.1 (Debian Based) to test it. I would appreciate if anyone tests it out with other versions of python that are lower than 3.9.2. I will try to add support for other gui libraries in the future, like wxPython, PyQt4, PySide2 etc.

Thanks to Cerberus for testing in python 3.8.5.

About

A python library for centering the Tkinter and PyQt windows.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages