-1
當添加少量文件但當文件列表> 500時崩潰時,我的程序正常工作。將元素添加到TreeView/ListStore後,應用程序崩潰
錯誤:
The program 'gui.py' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadAlloc (insufficient resources for operation)'.
(Details: serial 14768 error_code 11 request_code 53 minor_code 0)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)
驗證碼:
self.tf_idf_document_list = gtk.ListStore(str)
self.tf_idf_tree_documents.set_model(self.tf_idf_document_list)
self.tf_idf_tree_column.set_attributes(self.tf_idf_renderer, text=0)
在文件選擇我選擇與文件的文件夾,我將它們添加到列表中:
os.chdir(dir_name)
for file_name in os.listdir("."):
self.tf_idf_document_list.append([file_name])
任何建議如何修復這種BoF。
真有這沒有錯誤,TNX) – badc0re
,但爲什麼當我樹形視圖添加到Hbox我得到的錯誤,我認爲Hbox整個時間都在問題? – badc0re
嘗試將樹視圖添加到滾動窗口中,並將該滾動窗口放入hbox/vbox中。 – LiuLang