#!/usr/bin/python3

from gi.repository import Gtk

class HelloWorldApp(Gtk.Application):
    def __init__(self):
        Gtk.Application.__init__(self)
        self.connect("activate", self.onActivate)

    def onActivate(self, data=None):
        window = Gtk.Window()
        window.set_default_size(450, 75)

        headerBar1 = Gtk.HeaderBar()
        headerBar1.set_title("Header Bar As Window Title Bar")
        headerBar1.pack_start(Gtk.Button("1"))
        headerBar1.pack_end(Gtk.Button("2"))
        window.set_titlebar(headerBar1)

        headerBar2 = Gtk.HeaderBar()
        headerBar2.set_title("Header Bar As Window Child")
        headerBar2.pack_start(Gtk.Button("1"))
        headerBar2.pack_end(Gtk.Button("2"))
        window.add(headerBar2)     

        window.show_all()
        self.add_window(window)

if __name__ == "__main__":
    app = HelloWorldApp()
    app.run(None)
