"Varsha Purohit" <[EMAIL PROTECTED]> wrote > later part of the program. But i am not able to get the file name > and > display it in the text control. Here is the sample code. > > Fname = '' #Global variable to hold the file name.
You don't need this since its stored in self.filename. > class ScrolledWindow(wx.Frame): > def __init__(self, parent, id, title): > txt1 = wx.TextCtrl(panel, -1, pos=(30, 100), size=(150, 20)) If you want to write to it you need to store it in the object so this should be self.txt1 > txt1.write(Fname) You can't write the filename yet as it hasn't been fetched > > def OnOpen(self,event): > self.dirname = '' > dlg = wx.FileDialog(self, "Choose a file", self.dirname,"", > "*.*", wx.OPEN) > if dlg.ShowModal()==wx.ID_OK: > self.filename=dlg.GetFilename() Here you get the filename but don't write it to the text control HTH, Alan G. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor