<div dir="ltr"><div><font face="trebuchet ms,sans-serif">Thanks for the response Jeff, although your answer has spawned another question or two!&nbsp; In your answer, you showed that the attribute &quot; MySecondFrame.text_ctrl_2&quot; doesn&#39;t exist and to correct that, you suggested the code below.&nbsp; (What I understand from your response is that I can&#39;t reference the original object, but I must create an instance of it.&nbsp; Is that right??)</font></div>

<div><font face="trebuchet ms,sans-serif"></font>&nbsp;</div>
<div><font face="trebuchet ms,sans-serif">&nbsp;&nbsp;&nbsp; def MainToSecond(self, event): # wxGlade: MyMainFrame.&lt;event_handler&gt;</font></div>
<div><font face="trebuchet ms,sans-serif"></font>&nbsp;</div>
<div><font face="trebuchet ms,sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m = MySecondFrame(self)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m.Show()</font></div>
<div><font face="trebuchet ms,sans-serif"></font>&nbsp;</div>
<div><font face="trebuchet ms,sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m.text_ctrl_2.SetValue(&quot;This text was generated from the &#39;MainFrame&#39; window&quot;)</font></div>
<div><font face="trebuchet ms,sans-serif"></font>&nbsp;</div>
<div><font face="trebuchet ms,sans-serif">Here&#39;s where I get fuzzy...&nbsp; Let&#39;s say I&#39;ve got a &quot;frame_1&quot; object that&nbsp;opens a new &quot;frame_2&quot; object.&nbsp; As you&#39;ve suggested above, I&#39;ll use&nbsp;&quot;m&quot; to create an instance of a frame object.&nbsp;&nbsp;Now frame_2&nbsp;opens a &quot;dialog_1&#39;&quot; which asks for information that is sent back to &#39;frame_2&#39;. How do I reference &#39;frame_2&#39; in this case?&nbsp; Especially when frame_2 hasn&#39;t been closed and has just been waiting behind dialog_1 until dialog_1 closes.&nbsp; When I try to reference it again as &quot;m = frame_2(self)&quot; from a new function definition,&nbsp;aren&#39;t I creating a brand new frame_2 object that has &quot;blank&quot; attributes, so to speak?</font></div>

<div><font face="Trebuchet MS"></font>&nbsp;</div>
<div><font face="Trebuchet MS">I&#39;m sure I&#39;ve made things clear as mud, but hopefully with my blathering, someone will undertand my utter confusion!</font></div>
<div><font face="Trebuchet MS"></font>&nbsp;</div>
<div><font face="Trebuchet MS">Thanks everyone!</font></div>
<div><font face="Trebuchet MS">Adrian</font></div>
<div><font face="trebuchet ms,sans-serif"></font>&nbsp;</div>
<div><font face="trebuchet ms,sans-serif"></font>&nbsp;</div>
<div><br><br>&nbsp;</div>
<div class="gmail_quote">On Mon, Aug 18, 2008 at 3:29 PM, Jeff Younker <span dir="ltr">&lt;<a href="mailto:jeff@drinktomi.com">jeff@drinktomi.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div style="WORD-WRAP: break-word">
<div>
<div class="Ih2E3d">
<div>On Aug 18, 2008, at 9:13 AM, Adrian Greyling wrote:</div><br>
<blockquote type="cite"><span style="WORD-SPACING: 0px; FONT: 12px Helvetica; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate">
<div>&nbsp;&nbsp;&nbsp; def MainToSecond(self, event): # wxGlade: MyMainFrame.&lt;event_handler&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MySecondFrame(self).Show()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MySecondFrame.text_ctrl_2.SetValue(&quot;This text was generated from the &#39;MainFrame&#39; window&quot;)</div>
</span></blockquote>
<div><br></div></div>
<div>The expression MySecondFrame(self) creates a new object. &nbsp;It</div>
<div>initializes the new object by calling the MySecondFrame&#39;s __init__</div>
<div>method.&nbsp;</div>
<div><br></div>
<blockquote type="cite"><span style="WORD-SPACING: 0px; FONT: 12px Helvetica; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate">
<div><span style="COLOR: rgb(20,79,174)">class MySecondFrame(wx.Frame):</span></div>
<div>
<div class="Ih2E3d">&nbsp;&nbsp;&nbsp; def __init__(self, *args, **kwds):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # begin wxGlade: MySecondFrame.__init__<br></div>...</div></span></blockquote>
<blockquote type="cite"><span style="WORD-SPACING: 0px; FONT: 12px Helvetica; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate">
<div>
<div class="Ih2E3d">&nbsp; &nbsp; &nbsp; &nbsp;self.text_ctrl_2 = wx.TextCtrl(self, -1, &quot;&quot;, style=wx.TE_MULTILINE)&nbsp;<br></div>...</div></span></blockquote></div>
<div><br></div>
<div><br></div>
<div>
<div>The __init__ method calls sets the variable text_ctrl_2 in the object</div>
<div>m.</div>
<div><br></div></div>
<div>Your function MainToSecond is trying to get the attribute MySecondFrame.text_ctrl_2.</div>
<div>This attribute does not exist. &nbsp;You want to get the attribute m.text_ctrl_2. &nbsp;So, the method</div>
<div>should be:</div>
<div><br></div>
<div><span style="COLOR: rgb(0,0,0)">
<div>
<div class="Ih2E3d">&nbsp;&nbsp; &nbsp;def MainToSecond(self, event): # wxGlade: MyMainFrame.&lt;event_handler&gt;<br></div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;m = MySecondFrame(self)</div>
<div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;m.Show() 
<div class="Ih2E3d"><br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;m.text_ctrl_2.SetValue(&quot;This text was generated from the &#39;MainFrame&#39; window&quot;)</div></div>
<div><br></div></span></div>
<div><br></div>
<div>Also, method and function names should always start with a lower case letter: always</div>
<div>mainToSecond and never MainToSecond</div>
<div><br></div><font color="#888888">
<div>-jeff</div></font></div></blockquote></div><br></div>