I have the main application in file main.py and some UI classes in uiwidgets.py.
in main.py I have:
import uiwidgets as uiw
uiw.MultiColumnListbox(header, data)
def doSomething(self, n)
do something with n
in uiwidgets.py I have:
class MultiColumnListbox(object):
def __init__(self, header, data):
self.header=header
self.data=data
...
self.tree.bind( "<Double-Button-1>", self.OnClick)
def OnClick(self, event):
global return_index
item = self.tree.identify('item',event.x,event.y)
if item is not "":
return_index = (int((item[1:4]),16) - 1)
n = self.data[return_index][0]
I need to return the n value from class to main.py when the user click the widget. How can I do?