Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristhofer Travieso <cristhofert97@gmail.com>2013-06-04 18:47:46 (GMT)
committer Cristhofer Travieso <cristhofert97@gmail.com>2013-06-04 18:47:46 (GMT)
commit4d120162f858e78d97774d1b05fa97b27f0209b3 (patch)
treef597551f6d3982f3c4586ba062a923d9cccfd5c0
parent1126bec1eb9716492584ecac622362b85fd202bf (diff)
Add eventbox and color green
Signed-off-by: Cristhofer Travieso <cristhofert97@gmail.com>
-rw-r--r--game.py2
-rw-r--r--window.py17
2 files changed, 16 insertions, 3 deletions
diff --git a/game.py b/game.py
index 9c1f5bc..1a8bc82 100644
--- a/game.py
+++ b/game.py
@@ -32,7 +32,7 @@ LINE_WIDTH = 12
BACKGROUND_COLOR = (0, 1, 0)
-class Canvas(Gtk.Fixed):
+class Fixed(Gtk.Fixed):
def __init__(self):
Gtk.Fixed.__init__(self)
diff --git a/window.py b/window.py
index 29af610..0f013e8 100644
--- a/window.py
+++ b/window.py
@@ -17,12 +17,25 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
from gi.repository import Gtk
-from game import Canvas
+from gi.repository import Gdk
+from game import Fixed
+class Eventbox(Gtk.EventBox):
+ def __init__(self):
+ Gtk.EventBox.__init__(self)
+
+ #self.modify_bg(Gtk.STATE_NORMAL,
+ # self.get_colormao().alloc_color('green'))
+
+ parse, color = Gdk.Color.parse('green')
+ self.modify_bg(Gtk.StateType.NORMAL, color)
+
+ self.add(Fixed())
+
if __name__ == "__main__":
window = Gtk.Window()
window.connect('destroy', lambda w: Gtk.main_quit())
- window.add(Canvas())
+ window.add(Eventbox())
window.maximize()
window.set_title('Truco')
window.show_all()