Search code examples
pythonpython-3.xtkinter

How to set width/height of widgets within a Paned Window widget in Tkinter after initialization?


I'm trying to create a save/restore functionality in my Tkinter GUI, but I'm having trouble restoring the width/height of Widgets within a Paned Window. I've tried .place() and .config, but the resizable window around each of the widgets disappears and I can no longer resize each widget.

Example code:

from tkinter import *

root = Tk()
pw = PanedWindow(root)

text1 = Text(pw)
pw.add(text1)

text2 = Text(pw)
pw.add(text2)

entry1 = Entry(pw)
pw.add(entry1)

EDIT: No longer using TTK

EDIT2: No longer using Tkinter. Switched to PyQt5 and everything just works.


Solution

  • Just use PyQt5. Don't bother with Tkinter (Or worse, the TTK library).