From 902809bb9f16b98dcb5dd67ca9bc4553b05c2490 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sim=C3=B3n=20Pena?= Date: Mon, 17 May 2010 20:26:36 +0200 Subject: [PATCH] UI: Started basic window 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 | 7 +++++ ui/maeviesui/maeviesui/gui.py | 69 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100755 ui/maevies create mode 100644 ui/maeviesui/__init__.py create mode 100644 ui/maeviesui/favorites/__init__.py create mode 100644 ui/maeviesui/maeviesui/__init__.py create mode 100644 ui/maeviesui/maeviesui/gui.py create mode 100644 ui/maeviesui/util/__init__.py diff --git a/ui/maevies b/ui/maevies new file mode 100755 index 0000000..1c44489 --- /dev/null +++ b/ui/maevies @@ -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 index 0000000..e69de29 diff --git a/ui/maeviesui/favorites/__init__.py b/ui/maeviesui/favorites/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/ui/maeviesui/maeviesui/__init__.py b/ui/maeviesui/maeviesui/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/ui/maeviesui/maeviesui/gui.py b/ui/maeviesui/maeviesui/gui.py new file mode 100644 index 0000000..d5c1248 --- /dev/null +++ b/ui/maeviesui/maeviesui/gui.py @@ -0,0 +1,69 @@ +# -*- coding: utf-8 -*- + +########################################################################### +# Maevies +# Copyright (C) 2010 Simón Pena +# +# 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 . +########################################################################### + +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 index 0000000..e69de29 -- 1.7.9.5