<div dir="ltr"><div><font face="trebuchet ms,sans-serif">Thanks for the response Jeff, although your answer has spawned another question or two! In your answer, you showed that the attribute " MySecondFrame.text_ctrl_2" doesn't exist and to correct that, you suggested the code below. (What I understand from your response is that I can't reference the original object, but I must create an instance of it. Is that right??)</font></div>
<div><font face="trebuchet ms,sans-serif"></font> </div>
<div><font face="trebuchet ms,sans-serif"> def MainToSecond(self, event): # wxGlade: MyMainFrame.<event_handler></font></div>
<div><font face="trebuchet ms,sans-serif"></font> </div>
<div><font face="trebuchet ms,sans-serif"> m = MySecondFrame(self)<br> m.Show()</font></div>
<div><font face="trebuchet ms,sans-serif"></font> </div>
<div><font face="trebuchet ms,sans-serif"> m.text_ctrl_2.SetValue("This text was generated from the 'MainFrame' window")</font></div>
<div><font face="trebuchet ms,sans-serif"></font> </div>
<div><font face="trebuchet ms,sans-serif">Here's where I get fuzzy... Let's say I've got a "frame_1" object that opens a new "frame_2" object. As you've suggested above, I'll use "m" to create an instance of a frame object. Now frame_2 opens a "dialog_1'" which asks for information that is sent back to 'frame_2'. How do I reference 'frame_2' in this case? Especially when frame_2 hasn't been closed and has just been waiting behind dialog_1 until dialog_1 closes. When I try to reference it again as "m = frame_2(self)" from a new function definition, aren't I creating a brand new frame_2 object that has "blank" attributes, so to speak?</font></div>
<div><font face="Trebuchet MS"></font> </div>
<div><font face="Trebuchet MS">I'm sure I'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> </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> </div>
<div><font face="trebuchet ms,sans-serif"></font> </div>
<div><br><br> </div>
<div class="gmail_quote">On Mon, Aug 18, 2008 at 3:29 PM, Jeff Younker <span dir="ltr"><<a href="mailto:jeff@drinktomi.com">jeff@drinktomi.com</a>></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> def MainToSecond(self, event): # wxGlade: MyMainFrame.<event_handler><br> MySecondFrame(self).Show()<br> MySecondFrame.text_ctrl_2.SetValue("This text was generated from the 'MainFrame' window")</div>
</span></blockquote>
<div><br></div></div>
<div>The expression MySecondFrame(self) creates a new object. It</div>
<div>initializes the new object by calling the MySecondFrame's __init__</div>
<div>method. </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"> def __init__(self, *args, **kwds):<br> # 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"> self.text_ctrl_2 = wx.TextCtrl(self, -1, "", style=wx.TE_MULTILINE) <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. You want to get the attribute m.text_ctrl_2. So, the method</div>
<div>should be:</div>
<div><br></div>
<div><span style="COLOR: rgb(0,0,0)">
<div>
<div class="Ih2E3d"> def MainToSecond(self, event): # wxGlade: MyMainFrame.<event_handler><br></div> m = MySecondFrame(self)</div>
<div> m.Show()
<div class="Ih2E3d"><br> m.text_ctrl_2.SetValue("This text was generated from the 'MainFrame' window")</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>