I just created a dialog box with some text and an “OK” button, but wasn’t sure how to have the dialog close when the OK button was clicked.
I ended up calling getParentComponent()->setVisible(false), which works, but I wasn’t sure if there was a better way to do this. Should my component communicate with the dialog window in a more elegant way?
An unrelated follow-up: is there a way to set a button as the default button, so that if there are two choices (OK,cancel) one is highlighted, so the user knows that button will respond to the return key?