Ejemplo n.º 1
0
 def undo(self):
     start = self.textbuffer.get_iter_at_offset(self.start_offset)
     
     self.textbuffer.begin_user_action()
     insert_buffer_contents(self.textbuffer, start, self.contents,
                            add_child=add_child_to_buffer)
     cursor = self.textbuffer.get_iter_at_offset(self.cursor_offset)
     self.textbuffer.place_cursor(cursor)
     self.textbuffer.end_user_action()
Ejemplo n.º 2
0
    def undo(self):
        start = self.textbuffer.get_iter_at_offset(self.start_offset)

        self.textbuffer.begin_user_action()
        insert_buffer_contents(self.textbuffer,
                               start,
                               self.contents,
                               add_child=add_child_to_buffer)
        cursor = self.textbuffer.get_iter_at_offset(self.cursor_offset)
        self.textbuffer.place_cursor(cursor)
        self.textbuffer.end_user_action()
Ejemplo n.º 3
0
    def insert_contents(self, contents, it=None):
        """Inserts a content stream into the TextBuffer at iter 'it'"""

        if it is None:
            it = self.get_iter_at_mark(self.get_insert())

        self.begin_user_action()        
        insert_buffer_contents(self, it,
                               contents,
                               add_child_to_buffer,
                               lookup_tag=lambda name:
                                   self.tag_table.lookup(name))
        self.end_user_action()