X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1cc18e15f4fcb878fbda3c8ce615521e320d7bf6..cb56afc421319d1c7d88e117969cdc5fdea5fe85:/wxPython/demo/Main.py diff --git a/wxPython/demo/Main.py b/wxPython/demo/Main.py index 5edc12806a..fa4338f2fd 100644 --- a/wxPython/demo/Main.py +++ b/wxPython/demo/Main.py @@ -995,7 +995,7 @@ class DemoTaskBarIcon(wx.TaskBarIcon): if "wxMSW" in wx.PlatformInfo: img.Scale(16, 16) elif "wxGTK" in wx.PlatformInfo: - img.Scale(22, 22) + img.Scale(20, 20) # wxMac can be any size upto 128.128.... icon = wx.IconFromBitmap(img.ConvertToBitmap() ) return icon @@ -1012,13 +1012,9 @@ 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.getRobinImage()) + icon = self.MakeIcon(images.getBlom10MaskedImage()) self.SetIcon(icon, "This is a new icon") @@ -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() #--------------------------------------------------------------------------- #---------------------------------------------------------------------------