
from gi.repository import Gtk


class TestApp(Gtk.Application):

    def do_activate(self):
        textview = Gtk.TextView()
        textview.set_size_request(1, 1)

        scrolledwindow = Gtk.ScrolledWindow()
        scrolledwindow.set_policy(Gtk.PolicyType.NEVER,
                                  Gtk.PolicyType.AUTOMATIC)
        scrolledwindow.add(textview)

        win = Gtk.Window(application=app)
        win.add(scrolledwindow)
        win.show_all()

import sys

app = TestApp()
app.run(sys.argv)
