[pychess] push by gbtami - Fixed 'Enter game' lang selection button (still has layout problem) on 2015-01-01 15:04 GMT

2 views
Skip to first unread message

pyc...@googlecode.com

unread,
Jan 1, 2015, 10:05:08 AM1/1/15
to pychess...@googlegroups.com
Revision: 82cbe9d41dba
Branch: default
Author: gbtami
Date: Thu Jan 1 15:04:29 2015 UTC
Log: Fixed 'Enter game' lang selection button (still has layout
problem)
https://code.google.com/p/pychess/source/detail?r=82cbe9d41dba

Modified:
/lib/pychess/widgets/newGameDialog.py

=======================================
--- /lib/pychess/widgets/newGameDialog.py Tue Dec 30 17:24:10 2014 UTC
+++ /lib/pychess/widgets/newGameDialog.py Thu Jan 1 15:04:29 2015 UTC
@@ -565,7 +565,27 @@

cls._generalRun(_callback, _validate)

-class ImageButton(Gtk.DrawingArea):
+class ImageButton(Gtk.Button):
+ def __init__ (self, imagePaths):
+ GObject.GObject.__init__(self)
+
+ self.surfaces = [Gtk.Image().new_from_file(path) for path in
imagePaths]
+ self.current = 0
+
+ self.image = self.surfaces[self.current]
+ self.image.show()
+ self.add(self.image)
+
+ self.connect("clicked", self.on_clicked)
+
+ def on_clicked(self, button):
+ self.current = (self.current + 1) % len(self.surfaces)
+ self.remove(self.image)
+ self.image = self.surfaces[self.current]
+ self.image.show()
+ self.add(self.image)
+
+class xxxImageButton(Gtk.DrawingArea):
def __init__ (self, imagePaths):
GObject.GObject.__init__(self)
self.set_events(Gdk.EventMask.EXPOSURE_MASK |
Gdk.EventMask.BUTTON_PRESS_MASK)
Reply all
Reply to author
Forward
0 new messages