UI: Started basic window
authorSimón Pena <spenap@gmail.com>
Mon, 17 May 2010 18:26:36 +0000 (20:26 +0200)
committerSimón Pena <spenap@gmail.com>
Thu, 20 May 2010 17:48:35 +0000 (19:48 +0200)
A basic GTK Window is created. It just has three buttons, without
callbacks or any other functionality.

The goal is to implement the mockup at [1]

1. http://bit.ly/cIgcLw

ui/maevies [new file with mode: 0755]
ui/maeviesui/__init__.py [new file with mode: 0644]
ui/maeviesui/favorites/__init__.py [new file with mode: 0644]
ui/maeviesui/maeviesui/__init__.py [new file with mode: 0644]
ui/maeviesui/maeviesui/gui.py [new file with mode: 0644]
ui/maeviesui/util/__init__.py [new file with mode: 0644]

diff --git a/ui/maevies b/ui/maevies
new file mode 100755 (executable)
index 0000000..1c44489
--- /dev/null
@@ -0,0 +1,7 @@
+#!/usr/bin/env python
+
+from maeviesui.maeviesui.gui import Maevies
+
+if __name__ == "__main__":
+    maevies = Maevies()
+    maevies.run()
diff --git a/ui/maeviesui/__init__.py b/ui/maeviesui/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/ui/maeviesui/favorites/__init__.py b/ui/maeviesui/favorites/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/ui/maeviesui/maeviesui/__init__.py b/ui/maeviesui/maeviesui/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/ui/maeviesui/maeviesui/gui.py b/ui/maeviesui/maeviesui/gui.py
new file mode 100644 (file)
index 0000000..d5c1248
--- /dev/null
@@ -0,0 +1,69 @@
+# -*- coding: utf-8 -*-
+
+###########################################################################
+#    Maevies
+#    Copyright (C) 2010 Simón Pena <spenap@gmail.com>
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+###########################################################################
+
+import pygtk
+pygtk.require("2.0")
+import gtk
+
+class Maevies(gtk.Window):
+
+
+    def __init__(self):
+        gtk.Window.__init__(self)
+        self.set_title("Maevies - 0.1")
+        self.connect('delete-event',
+                     lambda widget, event: gtk.main_quit())
+
+        self._contents = gtk.HBox()
+        self._contents.set_border_width(20)
+        self._contents.set_homogeneous(True)
+        self._contents.pack_start(self._get_content_box("On Theaters"),
+                                  expand=True, fill=True)
+        self._contents.pack_start(self._get_content_box("Favorites"),
+                                  expand=True, fill=True)
+        self._contents.pack_start(self._get_content_box("Search"),
+                                  expand=True, fill=True)
+
+        self.add(self._contents)
+
+        self.show_all()
+
+    def _get_content_box(self, text):
+        favorites = gtk.VBox()
+        favorites.set_border_width(20)
+
+        button = gtk.Button()
+        foot_label = gtk.Label()
+        foot_label.set_text(text)
+
+        favorites.pack_start(button,
+                             expand=True, fill=True)
+        favorites.pack_start(foot_label,
+                             expand=False, fill=False)
+
+        return favorites
+
+    def run(self):
+        gtk.main()
+
+
+if __name__ == "__main__":
+    maevies = Maevies()
+    maevies.run()
diff --git a/ui/maeviesui/util/__init__.py b/ui/maeviesui/util/__init__.py
new file mode 100644 (file)
index 0000000..e69de29