Separator

A Separator widget is an ornamental widget which is used to split or group content within an interface. The Separator is a line drawn on the interface with a shadow to make it appear sunken.

Constructor

The Separator can be constructed using:

separator = Gtk.Separator(orientation)

The orientation parameter should be set to either Gtk.Orientation.HORIZONTAL or Gtk.Orientation.VERTICAL depending on the requirements. If no orientation is set, the default orientation used is set vertically.

Methods

The orientation can also be set after construction with:

seperator.set_orientation(orientation)

Examples

Below is an example of a Separator:

#!/usr/bin/env python3

from gi.repository import Gtk

class Separator(Gtk.Window):
    def __init__(self):
        Gtk.Window.__init__(self)
        self.set_default_size(400, 200)
        self.connect("destroy", Gtk.main_quit)

        box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
        box.set_homogeneous(True)
        self.add(box)

        separator = Gtk.Separator(orientation=Gtk.Orientation.VERTICAL)
        box.pack_start(separator, True, True, 0)

        separator = Gtk.Separator(orientation=Gtk.Orientation.HORIZONTAL)
        box.pack_start(separator, True, True, 0)

window = Separator()
window.show_all()

Gtk.main()

Download: Separator