#Hello, i will be extremely thankful if someone help me with solving the problem:
#i would like to pass on argument which is function reference, in other words
#i need to use the function as a argument and execute it
from wxPython.wx import *
# --------------------------------------------------------
class main_window(wxFrame):
def __init__(self, parent, id, title):
wxFrame.__init__(self, parent, -1, title, size=(800,600), style=wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE|wxWS_EX_VALIDATE_RECURSIVELY)
#panel = NEW(self,-1, ANYTHING)=> PASSING ON ANYTHING FUNCIONT
self.Show(true)
def ANYTHING(self):
print 'anything'
# --------------------------------------------------------
class NEW(wxPanel):
def __init__(self, parent,ID, func):
wxPanel.__init__(self, parent, ID,pos = (10,10),size = (100,100))
EVTEVT_LEFT_DOWN(self, self.OnLeftDown)
def OnLeftDown(self,evt):
pass
#>>>> HERE I WANT TO EXECUTE FUNCTION "FUNC"
class App(wxApp):
def OnInit(self):
frame = main_window(None, -1, "WINDOW")
self.SetTopWindow(frame)
return true
# --------------------------------------------------------
app=App(0)
app.MainLoop()
···
##
## THANKS IN ADV.
##
## Przemek Drochomirecki (Jagiellonian University)