def bw_set_text(self, text, f_before_scroll=None): """ """ if text != "": count = text.count('\n') + text.count('\r') lines = range(1, count + 2) lines = [str(i).strip() for i in lines] self.__textbuffer.set_text(text) self.__linebuffer.set_text('\n'.join(lines)) if self.__scroll: if f_before_scroll: f_before_scroll() update_gui() value = self.get_vadjustment().upper value -= self.get_vadjustment().page_size self.get_vadjustment().set_value(value) else: self.__textbuffer.set_text("") self.__linebuffer.set_text("")
def bw_set_text(self, text, f_before_scroll=None): """ """ self.__textbuffer.set_text(text) if self.__scroll: if f_before_scroll: f_before_scroll() update_gui() value = self.get_vadjustment().upper value -= self.get_vadjustment().page_size self.get_vadjustment().set_value(value)