Scrolling


Gtk.Scrollbar

— A Scrollbar

Gtk.ScrolledWindow

— Adds scrollbars to its child widget

Gtk.Scrollable

— An interface for scrollable widgets


Scrollbar example:

        vadjustment = layout.get_vadjustment()
        hadjustment = layout.get_hadjustment()

        vscrollbar = Gtk.Scrollbar(orientation=Gtk.Orientation.VERTICAL,
                                   adjustment=vadjustment)
        grid.attach(vscrollbar, 1, 0, 1, 1)
        hscrollbar = Gtk.Scrollbar(orientation=Gtk.Orientation.HORIZONTAL,
                                   adjustment=hadjustment)
        grid.attach(hscrollbar, 0, 1, 1, 1)

        scrolledwindow = Gtk.ScrolledWindow()
        self.add(scrolledwindow)

        layout = Gtk.Layout()
        layout.set_size(800, 600)
        layout.set_vexpand(True)
        layout.set_hexpand(True)
        scrolledwindow.add(layout)

results matching ""

    No results matching ""