[Tutor] wxPython

John Fabiani jfabiani at yolo.com
Tue Nov 16 23:45:35 CET 2004


On Tuesday 16 November 2004 20:45, L wrote:
> Hi All,
>
> I sent this to the wxPython mail list but haven't seen it appear. It might
> be too basic for them.
>
> I'm new to GUI programming and chose wxPython (after reading many rave
> reviews). My several Python books cover the old version (without the wx
> namespace).
>
> I would like to read from a text box on one form and write some results
> based on the read to another form. I suppose both forms have panels (that's
> how I designed things, using wxGlade). The text I will write is rather
> lengthy so I will write to a multiline scrollable text box.
>
> My paltry attempts at a solution so far have not resulted in success. Would
> anyone be able to contribute a small piece of code to get me started?
>
> Thanks,
> Lance

I'm not sure I can help but I think I understand what your asking.  I'll 
assume that you mean 'frame' when you say 'forms'.  If your opening one frame 
(a window) and typing into the multiline text and then click a button to 
transfer data and open a second frame with the info then"

Pass the frame1 info (first window/frame)  in the EVT_BUTTON event.

Something like 
frame = MainWindow(None,-1, "Main Window")
# you set up a var in secondWindow class like 
#self.textinfo =''
#then in the EVT_BUTTON event say something like
myframe=secondWindow(frame,-1,"second window")
myframe.textinfo = the value of the text control

I hope this helps.  As a newbie it has been working for me anyway.
John


                                     


More information about the Tutor mailing list