gtk-error **: gtk_text_btree_previous_line ran out of lines aborting

一曲冷凌霜 提交于 2019-12-12 06:48:47

问题


Backstory: I am doing a irc bot with a gui. I have a textbuffer to show chat.(telling the textbuffer thing because I think it might be the problem)

The bot runs ok for a couple of seconds and then gives this error:

gtk-error **: gtk_text_btree_previous_line ran out of lines aborting...

My code is here. The main file is run.py.


回答1:


Well im fumb I first tested this code:

if chatbuffer.get_line_count() > 10:
    chatbuffer.delete(chatbuffer.get_iter_at_line(0), chatbuffer.get_iter_at_line(5))

To know if it worked, bu then forgot to change the 10 to 500 on the final code, and it stayed like this:

if chatbuffer.get_line_count() > 10:
    chatbuffer.delete(chatbuffer.get_iter_at_line(0), chatbuffer.get_iter_at_line(250))

And that was the cause of the error, as soon as changed it to 500 it started working:

if chatbuffer.get_line_count() > 500:
    chatbuffer.delete(chatbuffer.get_iter_at_line(0), chatbuffer.get_iter_at_line(250))


来源:https://stackoverflow.com/questions/35966373/gtk-error-gtk-text-btree-previous-line-ran-out-of-lines-aborting

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!