![]() Window_height = 200 # get the screen dimension The following program illustrates how to do it: import tkinter as tk Sometimes, you may want to center the window on the screen. The following example changes the size of the window to 600x400 and the position of the window to 50 pixels from the top and left of the screen: import tkinter as tk To change the size and position of a window, you use the geometry() method: window.geometry(new_geometry) Code language: Python ( python ) Conversely, a value of -50 indicates the bottom edge of the window should be 50 pixels above the bottom of the screen. For example, a value of +50 signifies the top edge of the window should be positioned 50 pixels below the top of the screen.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |