I have a container parent window which has a child window as a data member. Now suppose i've an event handler onClick for the container parent window that receives an wxMouseEvent when the parent window is clicked. Now, suppose I want to send some information, say(x, y) coordinates to the child window. I have 2 options here both of which work:
Option 1:
Create a member function inside the child window that takes two ints and then just call this member function from the event handler onClick of the parent window.
Option 2:
Create an event handler member function for the child window that has some event type as its parameter and then send the event from the parent window event handler onClick to the child window's event handler.
My question is which of the above two methods is better suited in this situation? I mean, is there an advantage of choosing one over the other? Like maybe the former is blocking while the latter is not. Or some advantages/disadvantages of choosing one over the other that I am unaware of?
I have tried both of them and they both work but I don't know which one to choose. I want to have just one of them instead of having and using them both.