#!/usr/bin/env python3
from gi.repository import Gtk
def on_text_view_draw(*args):
    print("Drawing...")

text_view = Gtk.TextView()
text_view.connect("draw", on_text_view_draw)
scroller = Gtk.ScrolledWindow()
scroller.add(text_view)
window = Gtk.Window()
window.connect("delete-event", Gtk.main_quit)
window.set_position(Gtk.WindowPosition.CENTER)
window.set_default_size(300, 100)
window.add(scroller)
window.show_all()
Gtk.main()
