Author: Not specified Language: python
Description: Not specified Timestamp: 2013-05-13 12:48:54 +0000
View raw paste Reply
  1. class MainClass():
  2.     def __init__(self, master):
  3.         self.foo = MyClass1(master, self)
  4.         self.bar = MyClass2(master, self)
  5.        
  6. class MyClass1():
  7.     def __init__(self, parent, app):
  8.         self.app = app
  9.        
  10.     def some_other_function(self):
  11.         pass
  12.        
  13. class MyClass2():
  14.     def __init__(self, parent, app):
  15.         self.app = app
  16.         some_function()
  17.  
  18.     def some_function(self):
  19.         # Call the other function
  20.         self.app.foo.some_other_function()
  21.    
View raw paste Reply