Problem with 'insert_at_cursor' attribute
        Posted  
        
            by 
                mivoligo
            
        on Ask Ubuntu
        
        See other posts from Ask Ubuntu
        
            or by mivoligo
        
        
        
        Published on 2012-06-29T10:52:50Z
        Indexed on 
            2012/06/29
            15:23 UTC
        
        
        Read the original article
        Hit count: 283
        
I made something, so after clicking a button, some text should appear in the TextView. Part of my code:
def on_button1_clicked(self, builer):
        self.writetest = self.builder.get_object("textview1")
        self.writetest.insert_at_cursor("something")
Unfortunately, when I click the button I get:
AttributeError: 'TextView' object has no attribute 'insert_at_cursor'
According to GTK Documentation there is such attribute: http://developer.gnome.org/gtk3/stable/GtkTextView.html#GtkTextView-insert-at-cursor
I have the same problem with Entry as well, if I change TextView to Entry.
But if I use set_text instead of insert_at_cursor in my code, it works.
© Ask Ubuntu or respective owner