Hamid K
Hamid K

Reputation: 1165

Python - Tkinter / manage size of parent window

I set my Tkinter parent geometry and title like below:

from Tix import Tk

class MyApp:
    def __init__(self, parent):

        self.myParent = parent
        self.myParent.geometry("530x340")
        self.myParent.title("SSPFAT")


root = Tk()
myapp = MyApp(root)

The problem that I have is that: when I open the application depending on the screen resolution on different consoles the application GUI size will be slightly different and user would not see the entire application GUI. Is there a way to automatically pack everything to the size specified?

Upvotes: 0

Views: 620

Answers (1)

Bryan Oakley
Bryan Oakley

Reputation: 386352

The best solution is to not set the size of the window. Instead, create appropriately sized widgets, use grid and/or pack, and let tkinter decide what the proper size of the window should be. Tkinter is extremely good at laying out the widgets.

Upvotes: 1

Related Questions