Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

I'm trying to bind a TextView to the key "text" by TextBuffer. I get the text, but this property is not recorded.

widget = self.builder.get_object('textbuffer_text')
settings.bind("text", widget, "text", Gio.SettingsBindFlags.DEFAULT)

I would be grateful for any hints or help

share|improve this question

1 Answer 1

I set it manually, but it is annoying.

widget = self.builder.get_object('textbuffer_text')
#~ self.settings.bind("text", widget, "text", Gio.SettingsBindFlags.DEFAULT)
text = self.settings.get_string("text")
widget.set_text(text, len(text))


def on_textbuffer_text_changed (self, widget):
    b,e = widget.get_bounds()
    self.settings.set_string("text", widget.get_text(b,e,False).decode('utf-8'))
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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