X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/49090f6f10909160d1fd52ba8919c9baeb46f649..f5bd42d10b90831eeb81bbdd913bf590b8974e62:/wxPython/demo/Main.py?ds=sidebyside diff --git a/wxPython/demo/Main.py b/wxPython/demo/Main.py index 9faf21fe84..fa4338f2fd 100644 --- a/wxPython/demo/Main.py +++ b/wxPython/demo/Main.py @@ -1012,10 +1012,6 @@ class DemoTaskBarIcon(wx.TaskBarIcon): def OnTaskBarClose(self, evt): self.frame.Close() - # because of the way wx.TaskBarIcon.PopupMenu is implemented we have to - # prod the main idle handler a bit to get the window to actually close - wx.GetApp().ProcessIdle() - def OnTaskBarChange(self, evt): icon = self.MakeIcon(images.getBlom10MaskedImage()) @@ -1054,6 +1050,8 @@ class wxPythonDemo(wx.Frame): self.Bind(wx.EVT_CLOSE, self.OnCloseWindow) self.Bind(wx.EVT_ICONIZE, self.OnIconfiy) self.Bind(wx.EVT_MAXIMIZE, self.OnMaximize) + self.Bind(wx.EVT_ACTIVATE, self.OnActivate) + wx.GetApp().Bind(wx.EVT_ACTIVATE_APP, self.OnAppActivate) self.Centre(wx.BOTH) self.CreateStatusBar(1, wx.ST_SIZEGRIP) @@ -1324,9 +1322,8 @@ class wxPythonDemo(wx.Frame): self.ShutdownDemoModule() overviewText = "" - # o If the demo returns a window it is placed in a tab. - # o Otherwise, a placeholder tab is created, informing the user that the - # demo runs outside the main window, and allowing it to be reloaded. + # o The RunTest() for all samples must now return a window that can + # be palced in a tab in the main notebook. # o If an error occurs (or has occured before) an error tab is created. if module is not None: @@ -1564,7 +1561,7 @@ class wxPythonDemo(wx.Frame): #--------------------------------------------- def OnIconfiy(self, evt): - wx.LogMessage("OnIconfiy: %d" % evt.Iconized()) + wx.LogMessage("OnIconfiy: %s" % evt.Iconized()) evt.Skip() #--------------------------------------------- @@ -1572,8 +1569,15 @@ class wxPythonDemo(wx.Frame): wx.LogMessage("OnMaximize") evt.Skip() + #--------------------------------------------- + def OnActivate(self, evt): + wx.LogMessage("OnActivate: %s" % evt.GetActive()) + evt.Skip() - + #--------------------------------------------- + def OnAppActivate(self, evt): + wx.LogMessage("OnAppActivate: %s" % evt.GetActive()) + evt.Skip() #--------------------------------------------------------------------------- #---------------------------------------------------------------------------