How to access a function defined in the parent object of an object ?

Hello,

How to access a function defined in the parent object of an object ?

(Typically to have a page from a notebook to access the function from the main frame)

Thanx

Robert

Hi Robert,

How to access a function defined in the parent object of an object ?

(Typically to have a page from a notebook to access the
function from the main frame)

If the main frame is the top level parent of your object, you could try something like:

MainFrame = wx.GetTopLevelParent(YourObject)
MainFrame.ExecuteMyFunction(whatever1, whatever2)

Andrea.

···

_________________________________________
Andrea Gavana (gavana@kpo.kz)
Reservoir Engineer
KPDL
4, Millbank
SW1P 3JA London

Direct Tel: +44 (0) 20 717 08936
Mobile Tel: +44 (0) 77 487 70534
Fax: +44 (0) 20 717 08900
Web: http://xoomer.virgilio.it/infinity77
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

Hello,

How to access a function defined in the parent object of an object ?

(Typically to have a page from a notebook to access the function from
the main frame)

Thanx

Robert

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

winmain = self.GetParent()
or
winmain = self.GetGrandParent()
or
winmain = self.GetGrandParent().GetParent()

you must find the main frame

and
winmain.myfunction()