Gtk.Separator


Gtk.Separator — A separator widget

Object Hierarchy:

    GObject
    ╰── GInitiallyUnowned
        ╰── Gtk.Widget
            ╰── Gtk.Separator
                ├── Gtk.HSeparator
                ╰── Gtk.VSeparator

Functions:

  • new (orientation:Gtk.Orientation) -> Gtk.Widget

Description:

Gtk.Separator is a horizontal or vertical separator widget, depending on the value of the GtkOrientable::orientation property, used to group the widgets within a window. It displays a line with a shadow to make it appear sunken into the interface.


Function Details:

new()

new (orientation:Gtk.Orientation) -> Gtk.Widget

Creates a new Gtk.Separator with the given orientation.

  • Returns: a new Gtk.Separator.

  • Since: 3.0


Example:

import gi
gi.require_version('Gtk', '3.0')
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()

results matching ""

    No results matching ""