Use set_buffer instead of instantiation parameter of TextView

GTK+-3 does not support instantiation with parameter.

issue6753
review43481002
This commit is contained in:
C?dric Krier 2017-09-11 21:41:28 +02:00
parent bd9efd84b0
commit ff6d272729
2 changed files with 4 additions and 2 deletions

View file

@ -416,7 +416,8 @@ if __name__ == '__main__':
win.add(vbox)
text_buffer = gtk.TextBuffer()
text_view = gtk.TextView(text_buffer)
text_view = gtk.TextView()
text_view.set_buffer(text_buffer)
vbox.pack_start(text_view)
setup_tags(text_buffer)

View file

@ -44,7 +44,8 @@ class TextBox(Widget, TranslateMixin):
def _get_textview(self):
if self.attrs.get('size'):
textbuffer = TextBufferLimitSize(int(self.attrs['size']))
textview = gtk.TextView(textbuffer)
textview = gtk.TextView()
textview.set_buffer(textbuffer)
else:
textview = gtk.TextView()
textview.set_wrap_mode(gtk.WRAP_WORD)