Jump to content

'exceptions.AttributeError'>:'Button' object has no attribute 'im_func'


Recommended Posts

Hey guys, im trying to do my own System instead of using public stuff (:D) 

 

i have a problem with setevent on a button, if i do this:

 

 

i get a error like this: LuckyBoxWindow.LoadDialog.BindObject - <type 'exceptions.AttributeError'>:'Button' object has no attribute 'im_func'

 

	def __Window(self):
		try:
			LoadPython = ui.PythonScriptLoader()
			LoadPython.LoadScriptFile(self, "UIScript/luckyboxwindow.py")
		except:
			import exception
			exception.Abort("LuckyBoxWindow.__LoadScript.LoadObject")
		try:
			GetObject = self.GetChild
			self.board = GetObject("board")
			self.titleBar = GetObject("LuckyBox_TitleBar")
			self.LuckyBox_Reward = GetObject("LuckyBox_Reward") #Zielitem Slot
			self.LuckyBox_Name = GetObject("LuckyBox_Name") #Ergänzung Slot
			self.RewardItemSlot = GetObject("RewardItemSlot") #Bonus hinzufügen Slot
			self.RetryButton = GetObject("RetryButton") # Fragezeichen - Systemerklärung
			self.RecvButton = GetObject("RecvButton") #Succestext
			self.Notice_Yang = self.GetChild("Notice_Yang")
			self.RecycleTitleName = self.GetChild("RecycleTitleName")
			self.NeedMoneySlot = self.GetChild("NeedMoneySlot")
			self.NeedMoney = self.GetChild("NeedMoney")
		except:
			import exception
			exception.Abort("LuckyBoxWindow.LoadDialog.BindObject")
		self.titleBar.SetCloseEvent(ui.__mem_func__(self.Close))
		self.NeedMoney.Hide()
		self.RewardItemSlot.SetOverInItemEvent(ui.__mem_func__(self.__OnOverInItem))
		self.RewardItemSlot.SetOverOutItemEvent(ui.__mem_func__(self.__OnOverOutItem))

		self.RetryButton.SetEvent(ui.__mem_func__(self.RetryButton))
		self.RecvButton.SetEvent(ui.__mem_func__(self.RecvButton))

		self.pos = int(pos)
		self.dwBoxVnum = int(itemVnum)
		self.current_trys = int(trys)
		self.start_gold = int(start_gold)
		self.reward_vnum = int(reward_vnum)

		self.tooltipItem = uiToolTip.ItemToolTip()
		self.tooltipItem.Hide()

 

@VegaS™ @Nirray @xP3NG3Rx 

 

 

@Gurgarath

 

Please buddys, try to help me :(

Link to comment
Share on other sites

self.RetryButton.SetEvent(ui.__mem_func__(self.RetryButton))
self.RecvButton.SetEvent(ui.__mem_func__(self.RecvButton))
https://docs.python.org/2/reference/datamodel.html

Change function names to something like def OnClickRetryButton and def OnClickRecvButton, they cannot be the same like button names

For example:

self.serverSelectButton.SetEvent(ui.__mem_func__(self.serverSelectButton))

 Instead of:

self.serverSelectButton.SetEvent(ui.__mem_func__(self.__OnClickSelectServerButton))


Is going to throw same AttributeError which is stated as:
 

0323 01:00:01004 ::   File "introLogin.py", line 714, in __LoadScript

0323 01:00:01005 ::   File "ui.py", line 82, in __init__

0323 01:00:01005 :: AttributeError
0323 01:00:01005 :: : 
0323 01:00:01005 :: 'Button' object has no attribute 'im_func'
0323 01:00:01005 :: 

 

  • Love 1

I completely abandoned working on the files for this game. I do not respond to private messages.

.png

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.