From 760fb45fab539d3b228076f64c3d6480e9e57fd7 Mon Sep 17 00:00:00 2001 From: Jordan Halase Date: Mon, 9 Mar 2020 13:40:51 -0500 Subject: First commit --- ui/MainWidget.py | 29 +++++++++++++++++++++++++++++ ui/__init__.py | 0 2 files changed, 29 insertions(+) create mode 100644 ui/MainWidget.py create mode 100644 ui/__init__.py (limited to 'ui') diff --git a/ui/MainWidget.py b/ui/MainWidget.py new file mode 100644 index 0000000..f285efc --- /dev/null +++ b/ui/MainWidget.py @@ -0,0 +1,29 @@ +# Copyright (C) 2020 Jordan Halase +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +# OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +import gi +gi.require_version('Gtk', '3.0') +from gi.repository import Gtk + +class MainWidget(Gtk.Box): + + def __init__(self): + Gtk.Box.__init__(self) + + self.button = Gtk.Button(label="Python Button") + self.button.connect("clicked", self.on_button_clicked) + self.pack_start(self.button, True, True, 0) + + def on_button_clicked(self, widget): + print("Hello, from a custom Python widget!") diff --git a/ui/__init__.py b/ui/__init__.py new file mode 100644 index 0000000..e69de29 -- cgit v1.2.1