Reputation: 15
I create a function where I perform actions with the grid of class Tk(). But when I run I have opened 2 or more Windows...
def gridOverriding(master):
"""
Метод организовывает сетку в соответствии с дизайном приложения.
"""
if type(master) is type(Tk()):
master.columnconfigure(0, weight=1)
master.rowconfigure(0, weight=0)
else:
messagebox.showinfo('Ошибка типов', 'Не верный элемент [1]!')
if __name__ == '__main__':
app = Tk()
app.title('Курсовая работа')
app.geometry('800x600')
gridOverriding(app)
app.mainloop()
Upvotes: 0
Views: 47
Reputation: 386240
This creates a window:
app = Tk()
... and this creates a window:
type(Tk())
Upvotes: 3