From 6332e818e7e24819727f550634f919e2378b7aba Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 18 Dec 2020 15:01:46 -0800 Subject: [PATCH] Add a MacReopenApp method for the superdoodle sample --- samples/doodle/superdoodle.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/samples/doodle/superdoodle.py b/samples/doodle/superdoodle.py index a0196e37..9d79c4af 100644 --- a/samples/doodle/superdoodle.py +++ b/samples/doodle/superdoodle.py @@ -412,6 +412,17 @@ class DoodleApp(wx.App, InspectionMixin, SoftwareUpdate): self.SetAppDisplayName('SuperDoodle') return True + def MacReopenApp(self): + """ + Restore the main frame (if it's minimized) when the Dock icon is + clicked on OSX. + """ + top = self.GetTopWindow() + if top and top.IsIconized(): + top.Iconize(False) + if top: + top.Raise() + #---------------------------------------------------------------------- if __name__ == '__main__':