<div class="gmail_quote">On Mon, Jan 23, 2012 at 3:42 PM, Ian Kelly <span dir="ltr"><<a href="mailto:ian.g.kelly@gmail.com">ian.g.kelly@gmail.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Exactly.  The line "app = MyApp(0)" creates a MyApp instance and then<br>
assigns it to "app".  As part of the MyApp creation process, it<br>
creates a MyFrame, which creates a Tab, which creates a Class1, which<br>
attempts to reference "app".  All of this happens before that<br>
"MyApp(0)" call has returned, so the result of that call has not<br>
actually been assigned to "app" yet.<br>
<br>
I suggest using wx.GetApp() instead.<br>
<br></blockquote><div>That totally makes sense. However I'm not sure I understand your suggestion how to use wx.GetApp()</div><div>Isn't the wxApp still not created before Class1 is instantiated so I still can't call wx.GetApp() in __init__ of Class1 can I? </div>
</div>