import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk

class MyWindow(Gtk.Window):

    def __init__(self):
        Gtk.Window.__init__(self, title="Simple Notebook Example")
        self.set_border_width(3)

        self.notebook = Gtk.Notebook()
        self.add(self.notebook)

        self.page1 = Gtk.Box()
        self.page1.set_border_width(10)
        self.page1.add(Gtk.Label('Default Page!'))

        self.header = Gtk.Box(Gtk.Orientation.HORIZONTAL)
        self.lbl = Gtk.Label("Plain Title!")
        self.header.pack_start(self.lbl, True, True, 0)
        self.header.pack_end(Gtk.Image.new_from_icon_name("window-close", Gtk.IconSize.MENU), True, True, 0)
        self.btn = Gtk.Button("sample")
        self.header.show_all()
        self.notebook.append_page(self.page1, self.header);


win = MyWindow()
win.connect("delete-event", Gtk.main_quit)
win.show_all()
Gtk.main()
