Answer the question
In order to leave comments, you need to log in
Why doesn't the child window capture and resizing function work?
There is an application, a finance planner in which I create a child window for adding expenses and income. At this stage, both the application and the window itself work, but in theory it is impossible to close the main window or at least somehow interact with it while the child window is open. As well as resizing the window. (But the above does not work at all)
here is a piece of code
def init_child(self):
self.title('Добавить доходы/расходы')
self.geometry('400x220+400x300')
self.resizable(False, False)
self.grab_set()
self.focus_set()
Answer the question
In order to leave comments, you need to log in
yes, when opening the code, there are no errors, and when opening a child window in the application, this pops up:
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\1\AppData\Local\Programs\Python\Python37\ lib\tkinter\__init__.py", line 1705, in __call__
return self.func(*args)
File "C:/Users/1/PycharmProjects/Household finance/main", line 20, in open_dialog
Child()
File "C :/Users/1/PycharmProjects/Household finance/main", line 25, in __init__
self.init_child()
File "C:/Users/1/PycharmProjects/Household finance/main", line 29, in init_child
self.wm_geometry( '400x220+400x300')
File "C:\Users\1\AppData\Local\Programs\Python\Python37\lib\tkinter\__init__.py", line 1841, in wm_geometry
return self.tk.call('wm', 'geometry', self. _w, newGeometry)
_tkinter.TclError: bad geometry specifier "400x220+400x300"
Everyone found a solution, in the line "400x220+400x300, it was necessary to change x to + "400x220+400+300
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question