Hi,
I am testing a small example program that has a dialog, within which a message box with an OK button is shown by the callback function of the dialog. I noticed that after pressing the Enter key to dismiss the message box, the Enter key is always passed to the parent (the dialog).
So, my understanding is that, if a dialog has a widget with the focus (like a message box as above mentioned), the key press to the widget is supposed to be consumed by the widget and NOT being passed to the parent. But why the Enter key is still passed to the parent (the dialog box) even though it should be used (consumed) by the message box's OK button?
Maybe I did it wrong. If so, what is the right way to implement it?
Thanks.
I am testing a small example program that has a dialog, within which a message box with an OK button is shown by the callback function of the dialog. I noticed that after pressing the Enter key to dismiss the message box, the Enter key is always passed to the parent (the dialog).
So, my understanding is that, if a dialog has a widget with the focus (like a message box as above mentioned), the key press to the widget is supposed to be consumed by the widget and NOT being passed to the parent. But why the Enter key is still passed to the parent (the dialog box) even though it should be used (consumed) by the message box's OK button?
Maybe I did it wrong. If so, what is the right way to implement it?
Thanks.