class ImageBox(Window): ui.py Fonksiyonunu Komple Bununla Değiştirin Tıklanma sorunu için class ImageBox(Window): def __init__(self, layer = "UI"): Window.__init__(self, layer) self.name="" self.eventDict={} self.argDict={} def __del__(self): Window.__del__(self) self.name="" self.eventDict={} self.argDict={} def RegisterWindow(self, layer): self.hWnd = wndMgr.RegisterImageBox(self, layer) def LoadImage(self, imageName): self.name=imageName wndMgr.LoadImage(self.hWnd, imageName) if len(self.eventDict)!=0: print "LOAD IMAGE", self, self.eventDict def SetAlpha(self, alpha): wndMgr.SetDiffuseColor(self.hWnd, 1.0, 1.0, 1.0, alpha) def GetWidth(self): return wndMgr.GetWidth(self.hWnd) def GetHeight(self): return wndMgr.GetHeight(self.hWnd) def OnMouseOverIn(self): try: self.eventDict["MOUSE_OVER_IN"]() except KeyError: pass def OnMouseOverOut(self): try: self.eventDict["MOUSE_OVER_OUT"]() except KeyError: pass def OnMouseLeftButtonUp(self): try: apply(self.eventDict["MOUSE_LEFT_UP"], self.argDict["MOUSE_LEFT_UP"]) except KeyError: pass def OnMouseLeftButtonDown(self): try: apply(self.eventDict["MOUSE_LEFT_DOWN"], self.argDict["MOUSE_LEFT_DOWN"]) except KeyError: pass def SAFE_SetStringEvent(self, event, func, *args): self.eventDict[event]=__mem_func__(func) self.argDict[event]=args def SAFE_SetMouseClickEvent(self, func, *args): self.eventDict["MOUSE_LEFT_DOWN"]=__mem_func__(func) self.argDict["MOUSE_LEFT_DOWN"]=args def SetOnMouseLeftButtonUpEvent(self, event, *args): self.eventDict["MOUSE_LEFT_UP"] = event self.argDict["MOUSE_LEFT_UP"] = args