def set_content(textview, content): with disable_text_style(textview): buffer_ = textview.get_buffer() start = buffer_.get_start_iter() end = buffer_.get_end_iter() buffer_.delete(start, end) if use_serialize_func: buffer_.deserialize(buffer_, MIME, start, content) else: deserialize(buffer_, buffer_, start, content, buffer_.deserialize_get_can_create_tags(MIME), None)
def set_buffer(self, value): self.text_buffer.handler_block_by_func(self.insert_text_style) start = self.text_buffer.get_start_iter() end = self.text_buffer.get_end_iter() self.text_buffer.delete(start, end) if _use_serialize_func: self.text_buffer.deserialize(self.text_buffer, MIME, start, value) else: deserialize( self.text_buffer, self.text_buffer, start, value, self.text_buffer.deserialize_get_can_create_tags(MIME), None) self.text_buffer.handler_unblock_by_func(self.insert_text_style)