[Python] Python - ThemedTKinterFrame - grid_columnconfigure weight does not work

Discussão em 'Python' iniciado por Stack, Agosto 29, 2025.

  1. Stack

    Stack Membro Participativo

    I'm using ThemedTKinterFrame to beautify my python app but I'm facing a problem with grid_columnconfigure that does not work as supposed. Infact, does not work at all.

    Code:

    import tkinter as tk
    import TKinterModernThemes as TKMT

    class App(TKMT.ThemedTKinterFrame):
    def __init__(self, theme, mode, usecommandlineargs=True, usethemeconfigfile=True):
    super().__init__("Switch", theme, mode, usecommandlineargs=usecommandlineargs, useconfigfile=usethemeconfigfile)
    self.switchframe1 = self.addLabelFrame("Switch Frame 1", sticky=tk.NSEW, row=0, col=0)
    self.switchvar = tk.BooleanVar()
    self.switchframe1.SlideSwitch("Switch1", self.switchvar)

    self.switchframe2 = self.addLabelFrame("Switch Frame 2", sticky=tk.NSEW, row=0, col=1)
    self.switchvar = tk.BooleanVar()
    self.switchframe2.SlideSwitch("Switch2", self.switchvar)

    self.root.grid_columnconfigure(0, weight=0)
    self.root.grid_columnconfigure(1, weight=1)

    self.run()

    if __name__ == "__main__":
    App("park", "dark")


    Result:

    [​IMG]

    [​IMG]

    Any help would be appreciated

    Continue reading...

Compartilhe esta Página