I am currently building my own text editor in Tkinter, and I am struggling to understand what event and geometry propagation is and how it works. I have dug all over the internet to find a definite answer, but I have yet to find one.
With that said, can someone please give me the rundown of what propagation is for events and the geometry manager? I feel like having a post focused on propagation will be beneficial to me and many other Tk/Tkinter users.
Here are some specific examples of what confuses me:
This method autocompletes curly braces, but why must I return "break" to have this work properly? Some other StackOverflow post (can't find it anymore) said that it stops the event from further propagating, but I do not know what this means.
def _curly_pressed(self, event):
self.text_field.insert(INSERT, "{}")
self.text_field.mark_set(INSERT, f"{self.text_field.index(INSERT).split('.')[0]}.{int(self.text_field.index(INSERT).split('.')[1]) - 1}")
return "break"
Furthermore, I wanted to keep the window from resizing when the Text widget fills with text. To do this, I had to use the grid_propogate method on the Frame containing the Text widget. I do not understand this, though.
self.grid_propagate(False)