Calling event manually

OK, I’m feeling a bit dense (might have to do with the weather or the severe lack of sleep I’m experiencing).

I’m attempting to set up a keyboard shortcut to close the app. I bound an event to the panel to catch the key combo which works fine, but I’m not finding what it would take to generate an event to close the app. There is no menu on the app or I’d just use an accelerator (which I tried but that didn’t seem to work). I do have a close button so I guess I can send a click event but I’m drawing a blank on exactly how to do that.

Any ideas appreciated.

Chuck

Call your frame’s Close method. By default when the last top-level window is closed then the MainLoop method returns.

Thanks Robin,

I was making it way more complicated than it needed to be. I’d forgotten that I get a reference to the parent frame, so I was trying to rig an event generator for an EVT_BUTTON on the Close button. :man_facepalming: