When I am writing my code, I find the following situation many times:
def Mwindow_stayontop(self, event):
if CFG["AlwOnTop"] == 1:
self.SetWindowStyle(wx.DEFAULT_FRAME_STYLE)
CFG["AlwOnTop"] = 0
else:
self.SetWindowStyle(wx.DEFAULT_FRAME_STYLE | wx.STAY_ON_TOP)
CFG["AlwOnTop"] = 1
Can anybody think of a simpler way of doing this? I tried to use SIN and COS to alternate the value between 0 and 1, but couldn't.
Ideas?