Hi, friends I'm programming with Tkinter/Tix. I want to use Tix.FileEntry, and only find fe_obj['value'] to get the selected file, is there any other way? As I find it may cause some memory problems, while used with tkMessageBox. Running the following codes, if I click "Work" twice, the program will crash before the 2nd warning sub-window pops up. Even if I comment the 2 lines of adding Label self.sflb, it still dump.
My pc is WinXP Version 2002 Service Pack 3, CPU is Intel Core2 2-core, with Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)] on win32. I find it may be due to conflicts with Tix.FileEntry. How to fix it? import Tkinter, Tix import tkMessageBox, tkFileDialog class Worker(): def __init__(self): self.root = Tix.Tk() self.sffm = Tkinter.Frame(self.root) self.sflb = Tkinter.Label(self.sffm, text='Select file :') self.sflb.pack(side='left') self.sfft = Tix.FileEntry (self.sffm) self.sfft.pack(side='left') self.btfm = Tkinter.Frame(self.root) self.gnbt = Tkinter.Button(self.btfm,text='Work', command=self.work) self.gnbt.pack(side='left') self.sffm.pack() self.btfm.pack() Tkinter.mainloop() def work(self) : ''' do all work ''' print 1 value = self.sfft["value"] # use showwarning/showerror, if click "Work' for 2 times, will dump tkMessageBox.showwarning('Title', '<%s>' % value) print '+%s+' % value if __name__=='__main__': worker = Worker()
_______________________________________________ Tkinter-discuss mailing list Tkinter-discuss@python.org http://mail.python.org/mailman/listinfo/tkinter-discuss