From 6dee0aef24c28eed28cb5a064b81c7736dfc6ef8 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Tue, 14 Jun 2016 12:33:16 -0400 Subject: [PATCH] add hello-world.py --- hello-world.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 hello-world.py diff --git a/hello-world.py b/hello-world.py new file mode 100755 index 0000000..c0a92e6 --- /dev/null +++ b/hello-world.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python3 + +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 = "Hello World!") + + self.button = Gtk.Button(label = "Click Me") + self.button.connect("clicked", self.on_button_clicked) + self.add(self.button) + + def on_button_clicked(self, widget): + print("Hello World!") + +window = MyWindow() +window.connect("delete-event", Gtk.main_quit) +window.show_all() + +Gtk.main()