Can’t you have extraArgs in the bind() method, like this?
button.bind(DGG.ENTER, printbuttoninfo, extraArgs = [buttoninfos[buttonindex]])
I get some lenghty error message:
Traceback (most recent call last):
File "C:\Panda3D-1.8.0\direct\showbase\EventManager.py", line 61, in eventLoop
Task
self.doEvents()
File "C:\Panda3D-1.8.0\direct\showbase\EventManager.py", line 55, in doEvents
processFunc(self.eventQueue.dequeueEvent())
File "C:\Panda3D-1.8.0\direct\showbase\EventManager.py", line 122, in processE
vent
messenger.send(eventName, paramList)
File "C:\Panda3D-1.8.0\direct\showbase\Messenger.py", line 388, in send
self.__dispatch(acceptorDict, event, sentArgs, foundWatch)
File "C:\Panda3D-1.8.0\direct\showbase\Messenger.py", line 473, in __dispatch
method (*(extraArgs + sentArgs))
File "test.py", line 53, in printbuttoninfo
buttoninfos[buttonindex] = info
File "C:\Panda3D-1.8.0\direct\gui\DirectGuiBase.py", line 435, in __setitem__
apply(self.configure, (), {key: value})
File "C:\Panda3D-1.8.0\direct\gui\DirectGuiBase.py", line 431, in configure
func()
File "C:\Panda3D-1.8.0\direct\gui\DirectFrame.py", line 69, in setText
text = textList[i]
TypeError: 'libpanda.PGMouseWatcherParameter' object does not support indexing
:task(error): Exception occurred in PythonTask eventManager
Traceback (most recent call last):
File "testpy", line 68, in <module>
run()
File "C:\Panda3D-1.8.0\direct\showbase\ShowBase.py", line 2630, in run
self.taskMgr.run()
File "C:\Panda3D-1.8.0\direct\task\Task.py", line 502, in run
self.step()
File "C:\Panda3D-1.8.0\direct\task\Task.py", line 460, in step
self.mgr.poll()
File "C:\Panda3D-1.8.0\direct\showbase\EventManager.py", line 61, in eventLoop
Task
self.doEvents()
File "C:\Panda3D-1.8.0\direct\showbase\EventManager.py", line 55, in doEvents
processFunc(self.eventQueue.dequeueEvent())
File "C:\Panda3D-1.8.0\direct\showbase\EventManager.py", line 122, in processE
vent
messenger.send(eventName, paramList)
File "C:\Panda3D-1.8.0\direct\showbase\Messenger.py", line 388, in send
self.__dispatch(acceptorDict, event, sentArgs, foundWatch)
File "C:\Panda3D-1.8.0\direct\showbase\Messenger.py", line 473, in __dispatch
method (*(extraArgs + sentArgs))
File "test.py", line 53, in rolloverButton
infotext['text'] = info
File "C:\Panda3D-1.8.0\direct\gui\DirectGuiBase.py", line 435, in __setitem__
apply(self.configure, (), {key: value})
File "C:\Panda3D-1.8.0\direct\gui\DirectGuiBase.py", line 431, in configure
func()
File "C:\Panda3D-1.8.0\direct\gui\DirectFrame.py", line 69, in setText
text = textList[i]
TypeError: 'libpanda.PGMouseWatcherParameter' object does not support indexing