Почему виджеты не добавляются в дочернее окно?

from tkinter import*
from clientcore import*
from tkinter import scrolledtext as scr

class ChildWindoDownlots():
    def childwindowdownlots(self):
        self.childwind = Toplevel(self.root)

        self.chk_state = BooleanVar()  
        self.chk_state.set(True) 
        self.checkbox = Checkbutton(self.childwind, text='Выбрать', var=self.chk_state)
        self.grid(column=0, row=0)

        self.btn = Button(self.childwind, text="gg")
        self.btn.grid(column=1, row=0)
        
        self.childwind.grab_set()

class ChildWindowInstall():
    def childwindowinstall(self):
        self.childwind = Toplevel(self.root)
        self.childwind.grab_set()

class Window(ChildWindowInstall, ChildWindoDownlots):
    def __init__(self):
        self.root = Tk()
        self.root.title("client")
        self.root.geometry("400x300")
        self.root.resizable(width=False, height=False)
        self.root.iconbitmap(r"images/client.ico")
        self.root["bg"] = "gray22"

        self.btn_install = Button(self.root, text="Install", command=self.childwindowinstall).place(x=10, y=10, width=190, height=50)
        self.btn_downlots = Button(self.root, text="Downlots", command=self.childwindowdownlots).place(x=200, y=10,width=190, height=50)
        self.console = scr.ScrolledText(self.root, state=DISABLED)
        self.console.place(x=10, y=70, width=380, height=220)

        self.insert_console('text')
        
        self.root.mainloop()

    def insert_console(self, content):
        self.console.configure(state=NORMAL)
        self.console.insert(INSERT, content)
        self.console.configure(state=DISABLED)
        

if __name__ == "__main__":
    Window()
  • Вопрос задан
  • 63 просмотра
Пригласить эксперта
Ответы на вопрос 1
mallo_c
@mallo_c
Зачем я изучил VBS???
Tkinter предназначен только для работы с одним окном. Два окна лучше не делать.
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы
19 апр. 2024, в 05:01
999999 руб./за проект
19 апр. 2024, в 03:52
1000 руб./за проект
19 апр. 2024, в 03:01
1000 руб./за проект