0

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 Answer 1

0

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))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.