From c5291f717b5e59bbe5a7a5114f5fe3655c6df425 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alperen=20=C4=B0sa?= <66299502+Afacanc38@users.noreply.github.com> Date: Mon, 30 Aug 2021 15:21:49 +0300 Subject: [PATCH] Create 2-headerbar.py --- handy/2-headerbar.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 handy/2-headerbar.py diff --git a/handy/2-headerbar.py b/handy/2-headerbar.py new file mode 100644 index 0000000..e3ed258 --- /dev/null +++ b/handy/2-headerbar.py @@ -0,0 +1,36 @@ +import gi, os +gi.require_version("Gtk", "3.0") +gi.require_version("Handy", "1") +from gi.repository import Gtk, Handy + +Handy.init() + +class MyWindow(Handy.Window): + def __init__(self): + super().__init__(title="Hello World") + + # WindowHandle + self.handle = Handy.WindowHandle() + self.add(self.handle) + + # Box + self.box = Gtk.Box(spacing=6, orientation=Gtk.Orientation.VERTICAL) + self.handle.add(self.box) + + # Headerbar + self.hb = Handy.HeaderBar() + self.hb.set_show_close_button(True) + self.hb.props.title = "HeaderBar Example" + self.box.pack_start(self.hb, False, True, 0) + + # Label + self.lbl = Gtk.Label() + self.lbl.set_text("Hebele hübele") + self.lbl.set_justify(Gtk.Justification.CENTER) + self.box.pack_start(self.lbl, True, True, 0) + + +win = MyWindow() +win.connect("destroy", Gtk.main_quit) +win.show_all() +Gtk.main()